Screencast JavaScript Objects JavaScript

  • Jay McGavren
Badge student

Locked Content

A subscription is required for viewing this video. Enroll now to get full access to all Code School courses and content.

Enroll Now Sign in


  1. Maciej said

    I really like this screencast, a lot of information in a concise form :)

  2. klaasvaak said

    Is there a difference using this.constructor = FancyToilet or: FancyToilet.prototype.constructor = FancyToilet


  3. Faculty

    Jay McGavren said

    Both forms definitely set the correct constructor. I don't think you can go too far wrong with Mozilla's version.

  4. Oleh Sklyarenko said

    Seriously this introduction video is just great! Thank you

  5. Jonas Larsen said

    I needed to refresh my knowledge about JS prototypes, and this video was perfect! Thanks!

  6. xeronu said

    great screencast!

  7. wills said

    agreed. This is pretty good.

  8. vincent said

    You say that "function flush()" and "var flush = function()" are the same. but when your asigning a function to a variable only the variable declarion gets hoisted, while using the function keyword the entire function gets hoisted.

  9. Faculty

    Jay McGavren said

    Vincent: good catch - I had not been aware of the difference!

  10. oneiota said

    Ditto. Love the fundamental practicality this presents.

  11. Patrick Westerberg said

    This was awesome! Need more, so do a full Course please :)

  12. Irl Nathan said

    Agree on the level of awesomeness as well as the need for an entire course.

  13. Diego d'Ursel said

    Good screencast! The beginning was a little bit slow, and the end maybe a bit too fast. But it was worth watching. As Vincent said, I knew there was a difference between "function flush()" and "var flush = function()" but I can't tell the use of that. I'm definitely looking for an entire course on JS.

  14. Olga said

    DIEGO D'URSEL: suppose you want a funtion inside and if statement, sometimes you do, then var foo = function(){} is allowed way opposed to function foo(){}, the ECMA standard prohibits the latter. Also as Vincent said there is hoisting of vars, the effect is that funtion foo() {} is available anywhere from top to bottom, whereas var foo = function(){} is available from the assignment and downward. (Do not forget scope)

  15. Jake Craige said

    Another +1 for the having a course. It doesn't really make sense to me that there are multiple courses on js frameworks but none on just vanilla js! I'd rather start with that before learning the frameworks, so I'm forced to use another resource for that

  16. UzmaKR said

    Screencast is a good intro. However, the part on prototypes needs to be clarified. The instructor goes too fast. I had to review the part on the FancyToilet prototype several times before i got it.

  17. phaNTzy said

    to fast , its so important to understand this issue , there is a need for more video in this subjects , there are beginners here !

  18. Jeremy said

    You need to slow down Jay!

  19. SebastianM said

    Way too fast at the end with the prototype stuff.

  20. Iago said

    I also think it is too fast in the middle of it, but I have learn something

  21. João Ramos said

    Brilliant wrap-up. Bonus points for being compact and informative over tedious and lengthy.

  22. jdbrown371 said

    All the basics in under 10 minutes except that I have a problem not LMAO when exposed to potty humor and had to restart the video several times to make it to the end.

  23. kayris said

    Great stuff!

  24. amccarthy said

    very good tut. more along this line would be great. :)

  25. Peter said

    Wow, I've been looking for a good, succinct glossary/definition of these distinctions. Thanks! Well done.

  26. Bruno Garcia said

    Really awesome introductory video!

  27. ribildayeva said

    Jay, too fast! Had to rewind and listen closely to some half-dozen of pieces of the video multiple times.

  28. sh0wtym3 said

    This was a nice explanation of the fundamentals regarding Javascript objects... But really out of billions of possible example objects you chose a toilet? :)

  29. Robert Cham said

    Good stuff although a little too fast to follow especially towards the end.

  30. andersonmilham said

    Too fast! I mean, I'm not fluent in English so it was very hard to follow. It would be great if you could speak slowly. But the content was great.

  31. simonswiss said

    Wow.. this is an incredible refresher in less than 10 minutes.

    About a year after watching the JS RoadTrips 1 - 3, i was able to work with confidence in JS but my constructor / prototypes knowledge needed a good ol' brush. This was just the perfect video for that!

  32. Parvez Alam said

    Good stuff

  33. danielrluke said

    Some say it was too fast. I would have agreed four months ago, but I've been studying, so I could keep up. As for using a toilet, that was kinda sketch, but at least it was memorable, ad that's sort of the point with these tutorials.

  34. alexander shekhtman said

    what IDE was used?

  35. Manav Misra said

    This is an oldie, but goodie. I re-wrote the examples in my own IDE using ES2015 syntax for more practice.

    IDKW, but I completely lost it and cracked up when he implemented: Setting fire to ${this.brand}

    I guess just the dry presentation with the thought of a toilet being set on fire was just very funny to me. :)

  36. Manav Misra said

    ```function FancyToilet(brand) {, brand); // this.constructor = FancyToilet; }

    FancyToilet.prototype = new Toilet();

    FancyToilet.prototype.useBidet = function() { console.log('Ahh, refreshing!'); } `` toilet_humor.js:24 Uncaught TypeError: FANCY_TOILET.useBidet is not a function` :( ???

About This Screencast

In this screencast, Jay McGavren gives you a clear, no-nonsense look at JavaScript objects. You'll learn how properties and functions are woven together to make a complete object. You'll learn what's special about constructor functions (not that much), and how prototypes form the basis for creating new objects. If you're ready to take the next step with your JavaScript development, this tutorial will show you how.

You need to be an enrolled student in order to view this video and subscribe.

Enroll Now