|
|
|
|
|
by phpnode
4181 days ago
|
|
> 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: function Thing () {}
Thing.prototype.greet = function () { alert("hello"); };
and class Thing {
greet () {
alert("hello");
}
}
They are the same, so it introduces no new traps for library authors. |
|