JavaScript, ES6 – Lecture 1 – CS50's Mobile App Development with React Native




00:00:00 – ECMAScript
00:03:35 – Closures
00:13:47 – Immediately Invoked Function Expression
00:22:53 – First-Class Functions
00:34:19 – Synchronous? Async? Single-Threaded?
00:40:07 – Asynchronous JavaScript
00:40:18 – Execution Stack
01:00:18 – Overflow
01:01:47 – Asynchronous Functions
01:03:05 – Callbacks
01:09:41 – Promises
01:20:57 – Async/Await
01:26:32 – this
01:43:48 – Browsers and the DOM

Original source


36 responses to “JavaScript, ES6 – Lecture 1 – CS50's Mobile App Development with React Native”

  1. hi Jordan, I bet you are a very nice person and you know JS in and out and got very good grades. So, your professors thought you might be a good fit to teach this course. I don't think it is completely your fault but the best way to learn from your teaching is just taking the syllabus of yours and read/watch the material from somewhere else. Your explanations are very poor in terms of building an understanding around the topic. Reasoning is often lost and generally given at random points. Explanations for Closures, Prototypal inheritance, classess are impossible to grasp from you. Imperative vs Declarative Programming explanation is just funny.

  2. Editing is really not good. Why keep showing the presenter instead of the code? I see this over and over in code presentations. At most stick him in a little picture in picture box, this is really hard to follow.

  3. It would be really helpful if the code screen is always in the background. It's easier to follow the lecturer if we are allowed to study the code on the screen while the lecturer talks. Right now every time I try to look at the code more closely, the camera switches views away from the code and interrupts my concentration.

  4. The explanation on variable lifecycle is a little confusing. Let me explain more to help you better understand that concept. If I put anything wrong, critism and correction is always welcomed.

    First, remember this, the lifecycle of a variable declared with let is in the block scope(meaning you can't access it outside the code block where it was born) and that of one declared with var is in a function scope(same meaning with the function).

    Here is the code with comment I added.
    Copy the code into your editor to get better formatting and reading experience.

    function makeArray() { // If you declared the i with var, you can get it here bucause of hoisting and the var function scope lifecycle, but it will be undefined.

    const arr = []

    for (var i = 0; i < 5; i++) { //Beginning of the code block that i exists in.This is where i was born. You can use it from here if you used let.

    //If you were to log out the i value with var or let here, there will be no differences. They will both iterate as expected.

    arr.push(function () {
    console.log(i)
    })

    /They will also log out the same iteration here as expected.

    } //Curly ends. End of the code block with i. Since the lifecycle of a variable with let is the block scope, i with let dies right here. You can't get any i with let here.

    //But var still lives here cuz the lifecycle of a variable wtih var is the function scope and the function has not ended yet. So here you can log out the i with a value of 5 with var. It's not about the iteration of i.

    return arr /*This returns console.log(i). With let, it will use every i value in every iteration as expected cuz no i value outside the code block and therefore no value-shadowing. But with var, console.log(i) will directly use the i value outside the iteration code block because they are on the same level. Once the function finds an i, there is no need for it to dig into the code block to use the i there.*/
    } //Function ends, i with var dies

    const functionArr = makeArray()
    functionArr[0]()

  5. 9:40 i is not defined. It's not undefined. In JavaScript, not defined and undefined are totally two different things. Not defined is a kind of reference error and undefined is a kind of type.

  6. I have a question on 11:47,

    function makeFunctionArray = function() {
    const arr = []

    for (let i = 0; i < 5; i++) {
    arr.push(function() { console.log(i) })
    }

    return arr
    }

    const functionArr = makeFunctionArray()

    functionArr[0]()

    you say i 's scope is only from line four to line six, but can you turn the same for loop to a same while loop? when you turn the for loop to while loop, the let can't be in the {}, the result is 5, so how can explain the for loop?

Leave a Reply