mirror of
https://github.com/kamranahmedse/developer-roadmap.git
synced 2026-11-28 09:58:17 +08:00
* refactor: clean to roadmap content * refactor: move shared helpers into scripts/lib
8 lines
552 B
Markdown
8 lines
552 B
Markdown
# Weak Set
|
|
|
|
A `WeakSet` is a collection of objects held with weak references. Unlike a regular Set, it only accepts objects (not primitives), and entries are automatically removed when the object is garbage collected. WeakSet is used when tracking object references without preventing them from being garbage collected.
|
|
|
|
Visit the following resources to learn more:
|
|
|
|
- [@article@WeakSet](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet)
|
|
- [@article@WeakMap and WeakSet](https://javascript.info/weakmap-weakset) |