News for hackers. Stuff that matters.
Re:Introducing Hooks by beatgammit on Thursday October 25, 2018 @01:52PM (#18302909)
To be fair, JavaScript has been a moving target and things like classes are quite new. Then again, it doesn't make sense to avoid features just because they're new.

I think the point is that they want to provide two ways to do simple things: classes and functions. Functions have better performance, classes are more flexible.

Re:Introducing Hooks by krapp on Thursday October 25, 2018 @04:07PM (#18304144)
>I think the point is that they want to provide two ways to do simple things: classes and functions.

At the risk of seeming like an old man complaining about new things, what problem would "classes" solve in javascript that the existing object syntax, which allows for inner functions and variables, doesn't?

Re:Introducing Hooks by WorldMaker on Thursday October 25, 2018 @06:05PM (#18304992)
Prototypal inheritance, and scope controls more refined/easier to work with than IIFEs. In the end the class notation is "simply" syntax sugar giving the object syntax the benefit of Function.prototype and IIFE closures, without having to resort to layers of either/both.