Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

One of the slides mentions WeakMap. The issue with them is that they have weak keys, not weak values. If you're trying to keep track of weak values (say to prevent duplicate instantiations of managed objects, while still allowing them to be garbage collected, for example), WeakMap won't work.

https://developer.mozilla.org/en-US/docs/JavaScript/Referenc...

Is there any work to add weak values to JavaScript? There's a node module, but nothing for client-side code.

https://github.com/TooTallNate/node-weak



Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: