Any opinions about adding a Ruby-like ||= operator to EcmaScript?

Andy Earnshaw andyearnshaw at gmail.com
Wed Jul 29 11:31:09 UTC 2015


Plenty of opinions about it here: https://esdiscuss.org/topic/is-much-needed
;-)

On Wed, 29 Jul 2015 at 12:23 Behrang Saeedzadeh <behrangsa at gmail.com> wrote:

> For example:
>
>     obj.property ||= "value";
>
> This would only assign "value" to obj.property if property is undefined or
> null.
> --
> Best regards,
> Behrang Saeedzadeh
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150729/6a7fd04b/attachment.html>


More information about the es-discuss mailing list