Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardNodeJSV8 garbage collectionSingle-choice MCQ

Consider this code. What is the behavior with respect to V8's heap, and why?

const m = new Map(); for (let i = 0; i < 1e7; i++) { const k = 'key-' + i; // built at runtime m.set(k, { i }); } // nothing deletes from m