Existential operator (was: ||= is much needed?)

Brendan Eich brendan at mozilla.org
Tue Jun 19 10:29:14 PDT 2012


Allen Wirfs-Brock wrote:
> I still stand by my alternative semantics as being a way to address the more important use case without have ?()
No, the basis cases differ and that is a bug in your alternative.

foo?.bar means take bar from foo or undefined if foo == null.

foo?.bar() means take bar from foo and throw if foo == null else try to 
invoke the result if typeof "function", else undefined.

This is an off-by-one bug.

/be


More information about the es-discuss mailing list