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

Two object literals are built with the same keys but in different insertion order. Why does this hurt V8 performance at a shared read site?

function makePointA() { const o = {}; o.x = 1; o.y = 2; return o; } function makePointB() { const o = {}; o.y = 2; o.x = 1; return o; } // Many calls to both, then a shared function reads p.x + p.y