|
|
|
|
|
by chriswarbo
4181 days ago
|
|
I somewhat agree, but "adding tools" at the language level doesn't come for free: it causes an explosion in the number of interactions to keep track of. How do classes interact with prototypes? How do they interact with lexical scope? How do they interact with exceptions? etc. The egregious part is that, by turning something into a language feature, those who don't use it are often forced to take it into account in their code; especially library authors. |
|
No, `class` is syntactic sugar for the most common way of doing classes in ES3 and ES5. There is no semantic difference between:
and They are the same, so it introduces no new traps for library authors.