symbol
A JavaScript primitive value that is always unique, created with Symbol(), often used as a hidden property key.
In more detail
Non-registered symbols can be WeakMap keys because, like objects, they can become unreachable. Registered symbols from Symbol.for() live forever, so they cannot.
Related terms
- WeakMap — A key-value collection whose keys must be objects and are held weakly, so an entry disappears when its key object is garbage collected.
Taught in
- Memory Management: Garbage Collection, Memory Leaks And WeakMap — Frontend Architecture & Web Platform