undefined being treated as a missing optional argument

Brendan Eich brendan at mozilla.org
Fri Apr 13 12:17:54 PDT 2012


Argh, I've caught Allen's dropped-negative disease:

Brendan Eich wrote:
> I would be surprised if people wrote
>
>   function foo(a = default_a) {...}
>
> and wanted
>
>   foo(undefined)
>
> to bind default_a to a.

s/wanted/not want/

or else s/bind default_a to a/bind undefined to a/.

Will proofread thrice before sending henceforth.

/be


More information about the es-discuss mailing list