3 ms·
Most variables on JavaScript are (essentially) pointers. A common mistake people make in the language is keeping references to objects in a global map, which pr
by mind-blight 2y ago
Most variables on JavaScript are (essentially) pointers. A common mistake people make in the language is keeping references to objects in a global map, which prevents them from being garbage collected (often a bad caching implementation).
You can use things like WeakMap or WeakRef as one solution, but there are usually better options