Understanding Weak Reference In JavaScript
Smashing Magazine
MAY 25, 2022
WeakMap can be used in two areas of web development: caching and additional data storage. The result from a function can be cached so that whenever the function is called, the cached result can be reused. With WeakMap() , the cached result will be automatically removed from memory as soon as the object is garbage-collected.
Let's personalize your content