More fun with undefined
tj at crowdersoftware.com
Fri Jun 15 00:00:31 PDT 2012
On 15 June 2012 07:42, Herby Vojčík <herby at mailbox.sk> wrote:
> T.J. Crowder wrote:
>> Making a point of making this a separate thread from the current ?? and
>> ??= thread(s), which are thankfully looking close to consensus. So
>> that's infix and assignment.
>> Question: Should we consider unary as well?
> I also thought in these lines. What I came up is this:
> (foo??) // (foo !== undefined)
> foo??bar // (foo !== undefined) ? foo : bar aka foo ?? foo : bar
> that is, allow ?? also without the operand, but then only at the end of
Again, let's consider whether the semantics are worth it before we get into
synxtax. I take it you're in favor of something?
> P.S.: foo??bar:baz wouldn't hurt either, to complete the triad.
I've suggested that a couple of times. Brendan said he thought it was
"too thin." AFAIK no one else has weighed in on the subject.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss