Learn JavaScript

Lesson 6 of 9 · Objects, Destructuring, Spread and JSON

Module 8 · Objects, Destructuring, Spread and JSON

The Contest and Interview Pack: Deep Equality, Deep Clone, Flattening and a Bug Gallery

ProReading

Interviewers love objects, because one short question shows whether a candidate holds the right picture. "Write a function that checks if two objects are equal." "Copy this object so that changing the copy never touches the original." "What does this print?" Each takes ten minutes if you know the shape of the answer, and an hour if you do not.

Checking what this lesson needs for you…

What is inside The Contest and Interview Pack: Deep Equality, Deep Clone, Flattening and a Bug Gallery

  1. Pattern 1: deep equality
  2. Pattern 2: deep clone without structuredClone
  3. Pattern 3: what does this print, with references
  4. Pattern 4: flattening a nested object
  5. Pattern 5: versions of an object without copying it
  6. Six interview questions