Skip to main content

JavaScript Objects

11 lessonsAbout 66 minutesIntermediate

This part of the JavaScript Tutorial runs from JavaScript Objects through to JavaScript Object Constructors. There are 11 lessons here, and working through them takes about 66 minutes at a steady pace.

It follows on from JavaScript Arrays, so finish that first if you have not already — the examples below assume you are comfortable with it.

Each lesson below says what it covers before you open it. Read them in order the first time; afterwards this page works as a index you can jump back into when you need to check one thing.

  1. 1JavaScript ObjectsA JavaScript object stores related values together as named properties.
  2. 2JavaScript Object MethodsA JavaScript object method is a function stored as a property of an object.
  3. 3JavaScript Object keys and valuesObject.keys, Object.values and Object.entries turn an object into arrays you can loop over.
  4. 4JavaScript DestructuringJavaScript destructuring pulls values out of objects and arrays into their own variables.
  5. 5JavaScript Object SpreadThe JavaScript spread operator copies the properties of one object into another.
  6. 6JavaScript Optional ChainingJavaScript optional chaining reads a nested property without throwing when part of the path is missing.
  7. 7JavaScript Nullish CoalescingThe JavaScript nullish coalescing operator gives a fallback only when a value is null or undefined.
  8. 8JavaScript Getters and SettersJavaScript getters and setters let a method be used like a plain property.
  9. 9JavaScript JSONJSON is a text format for data, and JavaScript can convert objects to and from it.
  10. 10JavaScript Object freezeObject.freeze stops an object being changed after it is created.
  11. 11JavaScript Object ConstructorsA JavaScript constructor function builds many objects with the same shape.