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

2015-07-30 Thread Behrang Saeedzadeh
I am not very fussed about the syntax as long as the facility is in the language. Any chance this gets included in EcmaScript 2016? On Wed, Jul 29, 2015 at 10:26 PM Claude Pache claude.pa...@gmail.com wrote: Le 29 juil. 2015 à 13:23, Behrang Saeedzadeh behran...@gmail.com a écrit : For

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

2015-07-29 Thread Behrang Saeedzadeh
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@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

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

2015-07-29 Thread Andy Earnshaw
Plenty of opinions about it here: https://esdiscuss.org/topic/is-much-needed ;-) On Wed, 29 Jul 2015 at 12:23 Behrang Saeedzadeh behran...@gmail.com wrote: For example: obj.property ||= value; This would only assign value to obj.property if property is undefined or null. -- Best

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

2015-07-29 Thread Claude Pache
Le 29 juil. 2015 à 13:23, Behrang Saeedzadeh behran...@gmail.com a écrit : For example: obj.property ||= value; This would only assign value to obj.property if property is undefined or null. For me, that syntax suggests strongly: Assign `value` to `obj.property` if