Object.freeze(cat);
A getter’s value isn’t going to be frozen
Properties that have other objects as
their value need to be frozen
Slide 37
Slide 37 text
enumerable
Slide 38
Slide 38 text
only an object’s own
properties are enumerable*
*its parent’s (prototype)
properties will not be enumerable
Slide 39
Slide 39 text
Object.
getOwnPropertyDescriptors([])
{
length: {
value: 0,
writable: true,
enumerable: false,
configurable: false
},
__proto__: Object
}
we don’t want
these to show
up in a loop!
Slide 40
Slide 40 text
When possible, use Reflect, not Object!
Reflect
Slide 41
Slide 41 text
No content
Slide 42
Slide 42 text
objects are complex!
but also super cool
don’t be afraid to peek under the
hood at how they work!