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

> bob taught me about what a weak map should really do: keep a value alive when both the map and the key are alive. It blew my mind.

Can you share more details? That's so counter intuitive to how I think of WeakMaps and I would like to know more.



I called it a “weak map” rather than “WeakMap” deliberately. Bob was describing what he wanted, not what he got.

However, if memory serves, the JS weak map has the semantics bob wanted: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...




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

Search: