Everything in JavaScript is an object. Understanding object allocation, construction and inheritance is key to being fluent in the language.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
objects-configure-properties
objects-constructing
objects-constructor-functions
objects-creating
objects-data-types
objects-enumerating-properties
objects-inheritance
objects-native-constructors
objects-object-create
objects-reference-and-value-types
.gitignore
README.md

README.md

Class: JavaScript Objects

JavaScript


Everything in JavaScript is an object. Understanding object allocation, construction and inheritance is key to being fluent in the language. If you're coming from a class based language, these concepts will be new. If you've already been working in JavaScript, this class will build more intution about what JavaScript is doing under the hood.

What's in this class?

  • Introduction: JavaScript Objects - Let's review what will be covered in this class.

  • What are Objects? - In this video I'll introduce the object data type and object properties. Then I'll show you how you can visualize objects and containers or tables of property keys and values.

  • Constructing Objects - All objects in JavaScript initially look the same. After an object has been created we can construct the object by adding properties to it. In this video I'll show you what it means to create and construct an object. Then I'll show you what's happening when you use the "new" operator with a constructor function.

  • Configuring Object Properties - Object properties have hidden configuration options that tell JavaScript how a property should behave. For example, we can tell JavaScript that a property is readonly. In this video I'll show you how to configure properties on an object.

  • Objects Inherit from Other Objects - Objects inherit directly from other objects in JavaScript. This concept can be particularly confusing if you come from a class based language like Java or C#. In this video I'll show you how object inheritance works with code examples, diagrams and the Chrome debugger.

  • Creating Objects with Object.create - Object.create allows us to easily create a new object and set up inheritance from another object. I'll review the steps of creating a new object and setting up its prototype chain. Then you'll see how to use the Object.create method to do the same.

  • Using Constructor Functions - Constructor functions are one of the most common ways to create and construct new objects. I'll show you exactly what's happening when you use the "new" operator with a constructor function and review exactly how inheritance and property lookup works using code examples, diagrams and the debugger.

  • Data Types - JavaScript is a dynamically typed language. But it still has a few types including primitives and objects. In this video I'll introduce the type system and various types. I'll also introduce you to some vocabulary like "dynamic typing" and "immutable" vs "mutable" values.

  • Reference and Value Types - What happens when you assign a value to a variable? Do we copy the value or just store a reference to it? In this video I'll show you the difference between value types and reference types. We'll visualize how a value is stored for a variable, and what happens on assignment.

  • Native Constructor Functions - JavaScript comes with several "native" constructor functions for everything from Object to Boolean. In this video I'll show you around some native constructor functions. I'll also explore how native constructor functions are used with primitive types like booleans and numbers.

  • Enumerating Properties and hasOwnProperty - One of the most common tasks for working with objects in JavaScript frameworks is to enumerate and access properties on objects. In this video I'll show you how to enumerate properties and determine if a property exists on the immediate object or further up the prototype chain.