>
> > * 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.)

Sebastian

[1]
http://stackoverflow.com/questions/1071396/how-to-specify-only-some-optional-arguments-when-calling-function-in-coldfusion
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to