||= is much needed?

Brendan Eich brendan at mozilla.com
Tue Jun 12 19:36:00 PDT 2012


On Jun 12, 2012, at 5:57 PM, David Herman <dherman at mozilla.com> wrote:

> On Jun 12, 2012, at 11:02 AM, Brendan Eich wrote:
> 
>> It's possible ?? or however we spell it isn't worth adding, while ?= is. The conditional assignment to default or normalize is the prime use-case.
> 
> I'm skeptical. You don't foresee
> 
>    f(obj.x ?? defVal)
> 
> happening a lot? I do.
> 
> Dave
> 


No need to foresee. We have Ruby precedent along with CoffeeScript in sight. We also have JS as it is used today, where || is used almost exclusively on the callee side to supply default values.

/be


More information about the es-discuss mailing list