Engrain by ByteRush

JS.06.01 Mid-level

Property descriptors, freeze and seal

Comes up in: JavaScript

This concept is being written. It gets the full five steps — explanation, predict, interview angle, practice with tests, and review cards. Here is exactly what it will cover, so you can study it elsewhere in the meantime.

What it covers

  • writable/enumerable/configurable
  • accessor properties
  • Object.defineProperty
  • freeze (shallow) vs seal vs preventExtensions
  • property order rules (integer keys first)

Words you will know

property descriptoraccessorfreezeseal

What you will practise

  • deepFreeze
  • predict key order

Interview questions this answers

  • Does Object.freeze make an object deeply immutable?
  • In what order are object keys iterated?