Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardJavaScripthidden classes and inline cachesSingle-choice MCQ

Two object literals are created with the same keys but inserted in different orders. Why do they end up with different hidden classes (maps) in V8, and what is the practical consequence for inline caches in a function that reads them?

const o1 = { a: 1, b: 2 }; const o2 = { b: 2, a: 1 };