No. It has to be arguments[0]. Notice the braces around the argument list? This is meant to use destructured arguments. The argument list in this case has only 1 element, hence the `[0]`.
On Wed, Nov 28, 2018 at 3:26 PM Simo Costa <[email protected]> wrote: > @Ranando > > I think you meant: > ```js > F({par1, par2, ..., parN}) { > Object.assign(this, arguments); > } > ``` > This is briefly explained on github, anyway you'll get an undesired > 'length' property. > > Il giorno mer 28 nov 2018 alle ore 22:20 Ranando King <[email protected]> > ha scritto: > >> What about this: >> >> ```js >> F({par1, par2, ..., parN}) { >> Object.assign(this, arguments[0]); >> } >> ``` >> >> On Wed, Nov 28, 2018 at 2:20 PM Simo Costa <[email protected]> >> wrote: >> >>> @Claude >>> >>> Your suggestion is still too much verbose/ripetitive in my opinion >>> because you repeat the `this`keyword. I agree with the "limited use cases" >>> of my proposal but not with your concerns about the syntax, but I am open >>> for improvements on it. >>> I do not think that it could bring more mistuderstading than the >>> introduction of the rest/spread syntax has brought. >>> >>> And about the Object.assign solution, there are always (theoretically) >>> an object creation and a function call, as well as the repetition of the >>> parameters. >>> `Object.assign(this, {x, y});` >>> >>> >>> >>> >>> >>> >>> _______________________________________________ >>> es-discuss mailing list >>> [email protected] >>> https://mail.mozilla.org/listinfo/es-discuss >>> >>
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

