3 ms·
JS classes look like classes, behave like classes, and for all practical purposes are classes. They were one of the most useful additions to JS in recent years
by mschuetz 8y ago
JS classes look like classes, behave like classes, and for all practical purposes are classes. They were one of the most useful additions to JS in recent years and make code so much more readable compared to hacking things together with the prototype system. With the added bonus, that you can still modify the prototype of a class to replace functions for all already generated instances of that class.
- adrianhel 8y agoDon't disagree, but for React users onClick={this.doStuff.bind(this)} is pretty common for newbies who just read it somewhere and don't know of the perf implications of bind. But personally I prefer prototypal inheritance and the everything is an object mentality.
- deleted 8y ago[deleted]