||= is much needed?

T.J. Crowder tj at crowdersoftware.com
Thu Jun 14 14:32:46 PDT 2012

On 14 June 2012 21:45, Brendan Eich <brendan at mozilla.com> wrote:

> I can see adding ?? and ??= (undefined-only, not undefined-or-null).


> Is ||= really worth it? It would not assign if the left side is truthy,
> but perhaps no one will mind.

Nice-to-have. The fact it doesn't assign if the left side is truthy is the
only reason for having it, surely?

> Given ||= is there any oxygen left in the room for ??=?

??= regardless. ||= is a nice to have _in addition_ if there's really
enough impetus for it. In my code, I'd be using ??= a lot more often than

-- T.J.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120614/c2005690/attachment-0001.html>

More information about the es-discuss mailing list