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

Reply via email to