0

I don't know the exact answer. The main difference in the constructor comes when using inheritance. If we want to create a Student class that subclasses Person and add a studentId field, this is what we have to do in addition to the above.

  • It changes nothing - it's 2022, use native classes. – zerkms Nov 21 '22 at 06:00
  • I'd recall the only real difference between _ES6_ class and constructors was the ability to subclass native classes like Array. Currently there are more differences, like instances having private properties. – Teemu Nov 21 '22 at 06:01

0 Answers0