Continuing woes in reading the ES6 spec language
sebastianzartner at gmail.com
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. 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
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss