I'm of the opinion this is what decorators are for.
On Sun, Dec 2, 2018, 01:49 Ranando King Since some form of data is going to land in ES class syntax, it would be a
> good idea if the capabilities of a property descriptor were also exposed
> for all public properties.
>
>
Since some form of data is going to land in ES class syntax, it would be a
good idea if the capabilities of a property descriptor were also exposed
for all public properties.
https://github.com/rdking/proposal-common-member-modifiers
___
es-discuss
``this = { ...this, par1, par2, par3 }```
Oh, wait, I'm going to point out the problem with what I wrote before
anyone else does: this will lose any non-enumerable properties on `this`,
which in a class instance is kind of a big no-no. `Object.assign` is better
here.
On Sat, 1 Dec 2018 at 20:08
@Michael Luder-Rosefield
```js
this += { par1, par2, par3 }
```
I do love it!!!
Il giorno sab 1 dic 2018 alle ore 12:08 Michael Luder-Rosefield <
rosyatran...@gmail.com> ha scritto:
> > ```js
> this.{} = {par1, par2, par3};
> ```
>
> Of course, that could be expressed as ```this = { ...this,
@T.J. Crowder
No problems for the error :P.
Anyway I know Typescript's approach but I prefer something like:
```js
class Example {
constructor(this.{foo, #bar}) {
}
showFoo() {
console.log(e1.foo);
}
showBar() {
console.log(e1.#bar);
}
}
const e1 = new
> ```js
this.{} = {par1, par2, par3};
```
Of course, that could be expressed as ```this = { ...this, par1, par2, par3
}```, but that's still a bit verbose.
I already know this is going to get dismissed for changing the way the `+`
operator works, but it strikes me that a better way of expressing
On Fri, Nov 30, 2018 at 5:49 PM T.J. Crowder
wrote:
> which is
>
> ```js
> class Example {
> ...
> }
Apologies, that "which is" at the end of my previous message should have
been:
```js
class Example {
second;
#third;
fifth;
constructor(first, second, third, fourth, fifth)
7 matches
Mail list logo