Thoughts on WeakMaps

Brendan Eich brendan at mozilla.com
Tue Jun 7 09:02:03 PDT 2011


On Jun 7, 2011, at 7:41 AM, David Bruant wrote:

> Le 06/06/2011 17:31, David Bruant a écrit :
>> myWeakMap.set(key, value) doesn't return anything. It could return the previous value for the key (if such a thing exists). Is it intentional that the set function doesn't return anything?
> Anyone has thoughts on this point?

I've used that "return the old value" pattern with success before. Mark may have a reason for not using it here, though.

/be
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20110607/97410eba/attachment.html>


More information about the es-discuss mailing list