Question 1 of 16
JavaScript Weak References & FinalizationRegistry — Quiz
Check your understanding of weak liveness, WeakRef, FinalizationRegistry, unregister tokens, and nondeterministic cleanup.
Knowledge check
JavaScript Weak References & FinalizationRegistry — Quiz
Check your understanding of weak liveness, WeakRef, FinalizationRegistry, unregister tokens, and nondeterministic cleanup.
- Skip a hard question and review it before your results.
- Questions and answer options can shuffle between attempts.
You can retake this quiz whenever you like.
Question 2 of 16
What does WeakRef.prototype.deref() return when its target is unavailable?
Question 3 of 16
Which values are currently suitable WeakRef targets?
Question 4 of 16
Why can two synchronous deref() calls observe the same target after the first succeeds?
Question 5 of 16
What is the safest interpretation of WeakRef for a cache?
Question 6 of 16
What does FinalizationRegistry.register() associate with a target?
Question 7 of 16
Why is register(target, target) rejected?
Question 8 of 16
What does unregister(token) do?
Question 9 of 16
What does unregister() return when it removed a matching registration?
Question 10 of 16
What controls when FinalizationRegistry cleanup may occur?
Question 11 of 16
Can a FinalizationRegistry callback interrupt synchronous ECMAScript execution?
Question 12 of 16
What should deterministic resource release use?
Question 13 of 16
Why can cleanup callbacks be omitted?
Question 14 of 16
What is the role of an unregister token?
Question 15 of 16
Which statement about held values is correct?
Question 16 of 16
Which ownership boundary is correct?
Quiz results
Review
-
What is the primary property of a WeakRef target?Hint used
-
What does WeakRef.prototype.deref() return when its target is unavailable?Hint used
-
Which values are currently suitable WeakRef targets?Hint used
-
Why can two synchronous deref() calls observe the same target after the first succeeds?Hint used
-
What is the safest interpretation of WeakRef for a cache?Hint used
-
What does FinalizationRegistry.register() associate with a target?Hint used
-
Why is register(target, target) rejected?Hint used
-
What does unregister(token) do?Hint used
-
What does unregister() return when it removed a matching registration?Hint used
-
What controls when FinalizationRegistry cleanup may occur?Hint used
-
Can a FinalizationRegistry callback interrupt synchronous ECMAScript execution?Hint used
-
What should deterministic resource release use?Hint used
-
Why can cleanup callbacks be omitted?Hint used
-
What is the role of an unregister token?Hint used
-
Which statement about held values is correct?Hint used
-
Which ownership boundary is correct?Hint used