We were unable to load Disqus. If you are a moderator please see our troubleshooting guide.
Honestly I do not like this use of the auto-property generation. Better to be explicit by creating private data fields and public property accessors.
I like auto-property generation... who needs boilerplate code?
Strongly agree
Approved
+1
Thanks man for this
geat, 10x!
good post
Thanks Sir!
I do not understand why we can not something similar across constructor body, like of public/private/protected used inside constructor, like public name = options.name; autodeclare field instead of typing it twise - as declaration and.at in-constructor assignment.
How does this work with derived classes (child extends parent)?
Neat feature!
Super objetive. Super effective.
What if I pass my arguments as an object, can I deconstruct the object and create and assign private/public properties simultaneously?
Same question here, I'd say no.
The answer is no, we use a pattern where we do this, and have a `static` method for manufacturing the constructor.
e.g.static from({prop1, prop2}) => new this(public prop1, public prop2)
1000x loved it.
nice, thanks.
Aaa thank you so much for this... very simply put and all I needed to know :)