#weakreferences — Public Fediverse posts
Live and recent posts from across the Fediverse tagged #weakreferences, aggregated by home.social.
-
WeakMap REJECTS Primitive Keys?!
WeakMap has a SECRET rule! It ONLY accepts objects as keys. Try to use a string and it FAILS silently. This hidden restriction will cause bugs you'll never find!
#javascript #javascripttricks #weakmap #objectkeys #javascriptweird #javascriptquiz #codingchallenge #javascriptshorts #javascriptwtf #weakreferences #javascriptbugs #advancedjavascript
-
Memory Management in JavaScript with Weak References
This JSDev article shows advanced memory management using WeakRef and FinalizationRegistry. It explains how these help manage weak references and asynchronous object finalization, preventing memory leaks and efficiently handling resources. The article includes various examples and use cases. It's too bad the last example is buggy. (line 3)