Claude Pache (2017-02-04T02:46:16.000Z)
> Le 4 févr. 2017 à 02:12, Артем Гуржий <artem.gurzhii at gmail.com> a écrit :
> 
> Hi, I was thinking, is there a proposal for `or equal` operator as in ruby, or is there any sense for doing so?
> Example:
> ```js
> let a = 1;
> let b = 0;
> a ||= b;
> ```
> Would be interpreted as
> ```js
> a = a || b;
> ```
> PS:
> Ruby version is
> ```ruby
> a || a = b;
> ```
> They are both equal, but it doesn't look like the javascript version of doing this.

Older discussions on the topic: 

https://esdiscuss.org/topic/proposing-a-conditional-assignment-or-equals-operator <https://esdiscuss.org/topic/proposing-a-conditional-assignment-or-equals-operator>
https://esdiscuss.org/topic/new-assignment-operators-not-bit-wise-or <https://esdiscuss.org/topic/new-assignment-operators-not-bit-wise-or>
https://esdiscuss.org/topic/please-add-orequal-operator <https://esdiscuss.org/topic/please-add-orequal-operator>
https://esdiscuss.org/topic/is-much-needed <https://esdiscuss.org/topic/is-much-needed>
https://esdiscuss.org/topic/operators-and <https://esdiscuss.org/topic/operators-and>
https://esdiscuss.org/topic/logical-assignment-operators <https://esdiscuss.org/topic/logical-assignment-operators>

—Claude


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20170204/ddea1c7c/attachment-0001.html>
claude.pache at gmail.com (2017-02-04T02:50:39.496Z)
> Le 4 févr. 2017 à 02:12, Артем Гуржий <artem.gurzhii at gmail.com> a écrit :
> 
> Hi, I was thinking, is there a proposal for `or equal` operator as in ruby, or is there any sense for doing so?
> Example:
> ```js
> let a = 1;
> let b = 0;
> a ||= b;
> ```
> Would be interpreted as
> ```js
> a = a || b;
> ```
> PS:
> Ruby version is
> ```ruby
> a || a = b;
> ```
> They are both equal, but it doesn't look like the javascript version of doing this.

Older discussions on the topic: 

https://esdiscuss.org/topic/proposing-a-conditional-assignment-or-equals-operator  
https://esdiscuss.org/topic/new-assignment-operators-not-bit-wise-or  
https://esdiscuss.org/topic/please-add-orequal-operator  
https://esdiscuss.org/topic/is-much-needed  
https://esdiscuss.org/topic/operators-and  
https://esdiscuss.org/topic/logical-assignment-operators  

—Claude