4 ms·
One of the first things that made a bad impression on me was back in the day when classes were still used in the js world. I was not pleased when it told me I
by oblak 4y ago
One of the first things that made a bad impression on me was back in the day when classes were still used in the js world.
I was not pleased when it told me I have have to do
this.blahBlah = value
in the constructor because it didn't quite catch, and maybe still doesn't, that
Object.defineProperties(this, {
bla: { value: ... }
blah: {get, set}
})
is completely legit
That said, I do prefer ts to vanilla. It's less work than maintaining d.ts files
- reitanqild 4y agoBut who want to use Object.defineProperties when there is a clearer and shorter way? Or am I misunderstanding something?
- beebeepka 4y agoWhat's the shorter way of having an unmutable property?