Default argument values

Brendan Eich brendan at mozilla.org
Wed Feb 27 19:01:06 PST 2008


On Feb 27, 2008, at 6:56 PM, Steven Mascaro wrote:

> 2008/2/28 Brendan Eich <brendan at mozilla.org>:
>>>> function h({p:x,q:y} = {p:3,q:4}) [x,y]
>>>> h()
>>  3,4
>
> Unfortunately, it doesn't work when you want to specify a subset of
> the optional parameters. e.g.:
>
>>> h({p:1})
> 1,

True -- it's not the same as named parameters, for sure.

/be




More information about the Es4-discuss mailing list