Jump to content

JavaScript: Difference between revisions

302 bytes added ,  22 January 2020
Line 110: Line 110:


===Set===
===Set===
===WeakMap===
Unlike map, weakmap holds weak references to its keys. This allows keys to be garbage collected when no reference to it remains.
Note that once keys are garbage collected, they are also removed from the weakmap since you can no longer access them.
You can not iterate through a weakmap.


==Modules==
==Modules==