Continuing woes in reading the ES6 spec language

Sebastian Zartner sebastianzartner at
Fri Sep 13 14:52:34 PDT 2013

> > * You can pass undefined to trigger defaulting -- this is important for
> composition / delegation.
> No, it's a terrible feature :D i'm unaware of any language that supports
> arbitrary ordering of arguments.

FWIW, ColdFusion allows to call functions with named parameters in an
arbitrary order.[1] This has one benefit: You can simply skip arguments in
the middle instead of having to provide a default value for them the call.

Transferred to JS syntax that would be:

function sayHello(a, b=true, c="people")
    return b ? a + " " + c : a;

foo(a="Hey", c="there!"); // returns "Hey there!"

(Excuse the poor example, but it should be enough to understand the idea
behind it.)


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list