These days it feels like everyone is attacking classes in JavaScript. Developers I respect say ES6 classes are a virus. We’ve compiled long lists on the reasons that ES6 classes are not awesome. Apparently, if we’re still brave enough to try them, we need advice on how to use classes and still sleep at night.
While I appreciate these insights and concerns, I’ve been torn on this issue. Should we avoid ES6 classes since more powerful and flexible alternatives exist? After a lot of debating, I’ve decided to use ES6 classes in some contexts, albeit carefully.
Here’s why.