Intermediate JavaScript
Q60 / 100

What is the purpose of FinalizationRegistry?

Correct! Well done.

Incorrect.

The correct answer is B) Running a callback when a registered object is garbage collected, for cleanup of associated resources

B

Correct Answer

Running a callback when a registered object is garbage collected, for cleanup of associated resources

Explanation

const registry = new FinalizationRegistry(value => { /* cleanup */ }); registry.register(obj, heldValue); fires callback when obj is GC'd.

Progress
60/100