Skip to content

Lesson 07 · JavaScript

JavaScript Foundations: Objects in Practice

Objects doing real work: methods and a first look at this, iteration with keys and entries, destructuring with defaults, and copying and merging with spread.

Prerequisites: JavaScript Foundations: Scope & Closures

Learning objectives
By the end of this lesson, you will be able to:
  • Attach methods to objects with shorthand and call them through this
  • Iterate an object's data with Object.keys, values and entries
  • Destructure objects and arrays, with defaults for missing pieces
  • Copy and merge objects with spread, knowing it copies shallowly
  • Choose between iteration, destructuring and spread for the job at hand