
Learn to run JavaScript in node and in the browser, install node, use the REPL for quick feedback, save and load scripts, and use the browser console for interactive testing.
Access, copy, and save the working files by downloading or extracting them, then place them on your desktop and open from the player or DVD.
Explore how objects act as containers in JavaScript, using object literals, adding and deleting properties, and accessing them with dot or bracket notation and variables to construct property names.
Explore how JavaScript handles primitives—undefined, number, string, and boolean—and how they briefly become objects when methods run, revealing the distinction between primitive and object types.
Access methods on objects using dot or bracket notation, invoke them with parentheses, and dynamically choose subtotal or total based on the final step in checkout with a tax rate.
Explore inner functions in JavaScript by encapsulating sales tax in a getTax inner function inside a cart total, and note how subtotal scope and this binding can trigger errors.
Apply discounts to cart items by category using forEach. Fix inner function this binding by introducing a that reference and finally rename this to cart for readability.
Invoke functions with call and apply, and control this binding to reuse methods across objects. See how arrays pass arguments and this is bound with call.
Explore function scope in JavaScript, how hoisting moves declarations, the difference between var and let, and how strict mode and implicit globals shape global scope.
See how closures in JavaScript support data hiding by keeping private variables alive through returned functions. Create counters with reset to demonstrate access control.
Learn how closures and immediately invoked function expressions (iife) fix asynchronous timing in JavaScript by creating a separate scope for each countdown step and correctly capturing values.
Learn how prototypes enable inheritance and shared methods across cart instances, moving the total function and an empty method to the prototype, with value properties in the constructor.
Use helper functions like extends.js to attach methods to a class prototype and to establish an extends-based prototype chain from animal to mammal to cat, ensuring constructor references remain correct.
Explore behavior injection in JavaScript, using mixins to add flight capabilities to prototypes, enabling objects like birds and planes to share behaviors through duck typing.
Object-oriented programming offers a natural, reusable way to package code with self-contained objects and class hierarchies that extend general concepts like vehicles, easing transitions to other object-oriented languages.
Explore JavaScript’s multi-paradigm design, from procedural to object-oriented to closures, using a shopping cart example to compare portability, reusability, and how each approach shapes software.
JavaScript continues to evolve and have an enormous impact on UI and app development for the web. In this course, you will learn how to write classically object-oriented programs in JavaScript, as well as how to take advantage of prototypal inheritance. This course is designed for users that already have experience with JavaScript. You will start by learning basic object-oriented programming concepts and JavaScript's object model, then jump into learning about scope in JavaScript. From there, Ethan will teach you about classically object-oriented JavaScript, such as object prototypes, the prototype chain, and data hiding. Finally, this training video will cover duck typing and behavior injection.