liorean wrote:
>> On Tue, May 5, 2009 at 11:37 AM, Peter Michaux <[email protected]> 
>> wrote:
>>>  function(a=1, b="defaultVal");
>>>
>>> And in this syntax will default values be used if the parameter is
>>> falsey or only if it is undefined?
> 
> 2009/5/5 Mark S. Miller <[email protected]>:
>> Or only if it is absent?
> 
> I've been out of the ECMAScript world for many months now, but IIRC in
> ES3 all formal parameters that are absent gets initiated to the value
> undefined. Not sure which side of the function call border that
> initiation takes place on, though. Wouldn't special casing absence
> from undefined value effectively introduce another state for a
> variable to be in, though, since the behaviour is indistinguishable in
> user code in ES3?

It's not indistinguishable; exactly the first arguments.length parameters
are present, regardless of whether they are undefined.

-- 
David-Sarah Hopwood ⚥

_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to