Named Paramters
Alexander Kit
alex.kit at atmajs.com
Mon Jul 13 07:51:15 UTC 2015
This is extremely for the optional parameters important
function foo (bar, bak=1, qux=2) {
}
// here I want `bar` to be default, but the `quux` take another value
foo(5, qux: 3);
People often suggest object destruction here, but it is then just a
workaround. And when the arguments are renamed during the minification, all
the labels in function calls can be minified accordingly too.
On 11 July 2015 at 23:47, Benjamin Gruenbaum <benjamingr at gmail.com> wrote:
> Hey, I wasn't able to find information about the current status of a named
> parameters propsosal:
>
> // as in:
> foo(bar = 5); // logs 5
>
> function foo(baz, bak, bar){
> console.log(bar);
> }
>
> Is this being considered? Was it decided for/against? Anyone working on it?
>
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150713/e8600ba2/attachment.html>
More information about the es-discuss
mailing list