Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardJavaScriptWeakRef and FinalizationRegistrySingle-choice MCQ

When are FinalizationRegistry cleanup callbacks permitted to run relative to the JavaScript job/microtask model, and what does this mean for code that relies on them?

const reg = new FinalizationRegistry(held => { console.log('finalized', held); }); reg.register(makeObj(), 'token-A'); // makeObj() is now unreachable