Re: Promises "if not omitted" language

On Monday, July 22, 2013, Boris Zbarsky wrote:

> On 7/22/13 12:14 PM, Domenic Denicola wrote:
>
>> FWIW I think there are two coherent choices here: `undefined`/function
>> only, or anything allowed, with non-functions triggering the default
>> behavior.
>>
>
> There's a third choice: undefined and both null trigger default behavior,
> functions get called, anything else is disallowed.


Not the same, but possibly very similar as at as far as developer
comprehension, re: default params: undefined triggers default param, but
null does not.

function f(a = "hi!") { return a; }

f();
// "hi!"
f(undefined);
// "hi!"
f(null);
// null


Rick



>
> Or is that what you mean by the "antipattern that DOM specs in particular
> have perpetuated"?
>
> -Boris
>
>

Received on Monday, 22 July 2013 18:39:27 UTC