Before the class keyword was introduced, js developers used prototype simulation classes to write code.
Now with class, what position does prototype have outside class inside and inside?
The Syntactic sugar of es6 …
classThe operation of the is too limited, and it is not necessary to use it in the end.
If nothing else, it is only written in class
static methodIf you want to write
Prototype attributeThere is no way out, still want to use
In addition, I heard that there has been a proposal to directly write the prototype attribute in class, babel has already supported it, but I don’t know how long it will take to officially launch it …
Another example is jQuery, which is unnecessary.
newIt is impossible to write the operator in class.
There are still many cases, basically can’t use class instead of …