A different semantics for WeakMap#get default value

Andrea Giammarchi andrea.giammarchi at gmail.com
Mon Jan 16 16:48:12 PST 2012


it's OK, 'cause is not called get ;-)

On Tue, Jan 17, 2012 at 1:46 AM, Kris Kowal <kris.kowal at cixar.com> wrote:

> On Mon, Jan 16, 2012 at 4:39 PM, Andrea Giammarchi
> <andrea.giammarchi at gmail.com> wrote:
> > then the method should be called "getOrSetIfNotThere(obj, def)" 'cause
> get()
> > would mislead too much
>
> I’ve been calling this method "getset" for about three years, hoping
> it would catch on :P
>
>
> https://github.com/kriskowal/narwhal-lib/blob/f182f2f0a952d75f06b0ebe142696056d2933501/lib/narwhal/util.js
>
> Kris Kowal
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120117/b5e088ac/attachment.html>


More information about the es-discuss mailing list