undefined being treated as a missing optional argument

David Herman dherman at mozilla.com
Fri Apr 13 12:02:55 PDT 2012


On Apr 13, 2012, at 11:48 AM, David Herman wrote:

> On Apr 13, 2012, at 11:35 AM, Oliver Hunt wrote:
> 
>> What happens if i have:
>> 
>> function foo(a=1, b=2) { log(a, b, arguments.length); }
>> 
>> foo();
> 
> 1, 2, 2

Oops: 1, 2, 0

Dave



More information about the es-discuss mailing list