JS›Objects
◈ObjectsbeginnerFreeJS
objectspreadJSONfor...inObject.freezeObject.assignSymboldefineProperty
0/8 done~69 min
1
Mental model: Objects
Mental
~5 min
2
The 12 object exceptions
Exceptions
~15 min
3
Predict the output
Predict
~10 min
4
True or False
T/F
~6 min
5
Fill in the blank
Fill
~5 min
6
Fix the bug
Fix Bug
~8 min
7
Spot the bug
Spot Bug
~5 min
8
Put it together
Cement
~15 min
1 / 8Read~5 min
Mental model: Objects
Build the right picture in your head before we practice.
Object spread and Object.assign both do SHALLOW copies — nested objects are still shared references. Object.freeze only prevents top-level property changes; nested objects inside a frozen object are still mutable.
When you spread an object ({...obj}), you copy the top-level key-value pairs. If a value is itself an object, you copy the reference — both the original and the copy point to the same nested object. Mutating the nested object changes both. Deep cloning requires structuredClone() or JSON.parse(JSON.stringify()) (which loses functions and special values).
Scroll to the bottom to continue
Notes
🔍
Loading…
Sections
0/8 done~69 min
1
Mental model: Objects
Mental
~5 min
2
The 12 object exceptions
Exceptions
~15 min
3
Predict the output
Predict
~10 min
4
True or False
T/F
~6 min
5
Fill in the blank
Fill
~5 min
6
Fix the bug
Fix Bug
~8 min
7
Spot the bug
Spot Bug
~5 min
8
Put it together
Cement
~15 min
Notes
Notes
🔍
Loading…