Javascript Essentials (Revised)




This is a revised edition of the JavaScript Essentials video I published well over 3 years ago. This includes some corrections to my previous video as well as some updated essentials. It is also a direct replacement for the previous video, so there is no need to watch both.

Original source


33 responses to “Javascript Essentials (Revised)”

  1. Hi Travis,
    I'm watching your great video and noticed a point (33:18) which i think was not clear enough.
    You're talking about scopes but another very important thing here is the execution scheduling: The setTimeout, moves the callback function into the event queue which is executed ONLY when the current execution stack is over (even if you use 0ms as the delay parameter).
    This means the anonymous function is executed AFTER the for loop has finished its all iterations, and THEN the scope issue arises to explain how the anonymous function is aware to the loop index when it runs.
    Thanks for your video!

  2. Hi Travis on 50:50 the code actually 'sayName'
    var person ={
    firstName: 'Izuchukwu',
    lastName: 'Anthony',
    sayName: function() {
    console.log(this.firstName + ' ' + this.lastName);
    }
    };

    //person.sayName();
    setTimeout(person.sayName(),2000);

    I guess you called a ver with "setTimeout(person.sayName.1000); instead of a function sayName()

  3. Hi Travis , I am new to JavaScript but understand some basic atm, But can i ask after printing out on the console the following
    console.log(parseInt(theMeaningOfLife, 10) + 2); what is the 10 for inside the bracket for ??

  4. Hello Travis,

    When you talked about the "this" in scope and context, I changed "person.sayName" to "person.sayName()" in the setTimeout.

    it worked in Chrome browser. Is this implicit in using the bind like the example in your video?

    var person = {
    firstName: 'Test',
    lastName: 'Test',
    sayName: function() {
    console.log(this.firstName + ' ' + this.lastName);
    }
    };

    setTimeout(person.sayName(), 1000);

  5. Hello Good people – I am learning to build apps (both mobile/Web) which I will then sell on app stores. I want to build a company in the future to do so. I have already invested in Treehouse and learned basics of python, swift, Javascript, SQL and HTML>CSS. Now I want to dig deeper – in an area where I start connecting the dots. Build a page connect it to a server, record data in a database. I want to DIY in the app world in short. What should I LEARN ???

  6. Hi Travis..Could you please clear my doubt. Why am I getting different results
    https://jsfiddle.net/vihano/w0cggd0s/

    var Fruit1 = function(name, color, shape) {
    this.currName = name;
    this.currColor = color;
    this.currShape = shape;
    this.describe = function() {
    return ("The color of " + this.currName + " is " + this.currColor + " and the shape is " + this.currShape);
    };
    };

    var Fruit2 = function(name, color, shape) {
    this.currName = name;
    this.currColor = color;
    this.currShape = shape;
    return {
    describe: function() {
    return ("The color of " + this.currName + " is " + this.currColor + " and the shape is " + this.currShape);
    }.bind(this)
    };
    };

    var apple1 = new Fruit1("Royal Gala", "Red", "Round");
    var apple2 = new Fruit2("Royal Gala", "Red", "Round");
    apple1.currName = "Washington Apple";
    apple2.currName = "Washington Apple";
    console.log(apple1.describe());
    console.log(apple2.describe());
    }

  7. I needed just 15 random seconds of this video to subscribe you. When i saw how you explain a simple function i knew that the whole video its awesome ! Best tutorial so far and really good explanations. I hope you're doing more videos. Keep up the good work.

  8. Thank you so much for this! So clear and concise, exactly what I was looking for. Really well thought out and intelligent examples throughout. The last 10 minutes started to get a bit challenging as the concepts started to stack up so had to listen over a few times. Not much better use of an hour than this!

  9. Very good content and well explained. Audio is quit good but if you want to make it perfect you might want to consider your room acoustic. Seems to interfere with the audio quite a bit because there is quite a bit of echo of your voice from the naked walls in the room. I am by no means an acoustic expert but i think your audio can become a bit more pleasant if you would either turn down your mic say 5-10%, perhaps try to put a muffler on the mic or putting some dampening material on your walls. Looking forward to more of your content. Well done. Thank you very much for your efforts.

Leave a Reply