Minor clarification on WeakMap and WeakSet

This commit is contained in:
Dawid Kopys 2020-10-24 13:31:46 +02:00
parent 2d5be7b730
commit 567d911f63

View file

@ -30,7 +30,8 @@ let array = [ john ];
john = null; // overwrite the reference
*!*
// john is stored inside the array, so it won't be garbage-collected
// the object previously referenced by john is stored inside the array
// therefore it won't be garbage-collected
// we can get it as array[0]
*/!*
```