On 13 June 2012 06:52, Brendan Eich <[email protected]> wrote:
> People don't default on the caller side (at the callsite) much, in my
> experience. Dave may be seeing other sources, but it's extremely rare in my
> experience to see
>
I'm with Dave on this, I do it fairly regularly, usually when a function
turns around and calls another one with the arg and has no other use for
the arg:
function doSomethingNifty(a, b) {
return doSomethingVerbose({
x: 1,
y: a,
z: b ?: 5
// ...
});
}
?= looks great, and Wes' point about confusion re ||= (or even |||=) and
boolean logical operators definitely kills my preferred ||| for the
non-assignment form if there's going to be an assignment form -- and we all
want an assignment form.
Is the reason for using ?: rather than ?? because we may want it for my
desired second ternary? E.g., from my other message:
a = b ?? c : d;
meaning
a = b !== undefined ? c : d;
Or that we want it (now, or in reserve) for something else? Because if not,
I'd prefer to see ?? rather than ?:. It's easier to type and the
double ??calls back to the related
||. But again, only if we don't want ?? (now, or in reserve) for something
else.
Very much looking forward to ?: (however we spell it) and ?=.
-- T.J.
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss