← concepts · the commons
class fields
4 moment(s) that assert this concept — showing 1–4 of 4
single sourceRests on a single channel — treat as a lead, verify independently
↣ how this spread over time →Chrome for Developers · youtube · en
1JavaScript class fields improve code simplicity by allowing instance properties to be declared directly in the class body without requiring a constructor
“The _count property is now nicely declared at the top of the class. We no longer need a constructor just to define some fields. Pretty neat!”
spoken · 400s · 2019-05-09
Chrome for Developers · youtube · en
2Subclassing in JavaScript has become more convenient with class fields, eliminating the need to call `super()` to initialize base class properties before adding new ones
“Class field syntax is especially convenient when dealing with subclasses that introduce additional fields. Consider this Animal base class for example. To create a Cat subclass that introduces an additional instance property, you’d previously have to call super() to run the constructor of the Animal base class before creating this property.”
spoken · 456s · 2019-05-09
Chrome for Developers · youtube · en
3JavaScript class fields eliminate the need for a constructor and super call
“the class field syntax removes the need for the whole constructor, including the awkward `super` call”
spoken · 482s · 2019-05-09
Chrome for Developers · youtube · en
4JavaScript supports both public and private class fields in Chrome and Node.js
“Chrome supports both public and private class fields, and so does Node.js”
spoken · 495s · 2019-05-09