Hidden classes (shapes) and inline caches
Comes up in: JavaScript, Web fundamentals
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
- shapes/maps
- adding properties in a consistent order
- monomorphic vs polymorphic vs megamorphic call sites
deleteand dictionary mode- element kinds for arrays (holey/packed)
Words you will know
What you will practise
- micro-benchmark caveats + a shape-friendly refactor
Interview questions this answers
- What are hidden classes and why should objects keep a consistent shape?