This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
// CASE 1: The object is mutable and the variable can be reassigned. | |
let o1 = { foo: 'bar' }; | |
// Mutate the object | |
o1.foo = 'something different'; | |
// Reassign the variable | |
o1 = { message: "I'm a completely new object" }; |