Skip to content
CodeWiki
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
Search
⌘K
English
English
Chinese
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
English
English
Chinese
Practice
/
Quiz
/
JavaScript
/
Memory management
What happens to a cycle of two objects when no GC root can reach either object?
from Memory management
Node 24
intermediate
1 min
What happens to a cycle of two objects when no GC root can reach either object?
The cycle is eligible for garbage collection.
The cycle must remain because both reference counts are nonzero.
JavaScript immediately calls a destructor on both objects.
Check
Ask AI about this kata
Report an error
previous kata
Spot the bug in ticker cleanup
Spot the bug
next kata
What does this WeakMap lookup print?
Predict the output
A new version is available
Reload