News for hackers. Stuff that matters.
Re:Future JavaScript: what is still missing? by scarface74 on Sunday January 27, 2019 @03:11PM (#19013530)
I’m going to butcher this. But, in the grand scheme of things a “class” in most languages is just a group of related static functions. When you create an object from a class definition you are creating an object that holds values. When you call a method on that object, you are passing a pointer to the object to a static function.

It’s all just syntactic sugar in any language. Before the class keyword, it was just more explicit in JS.

A class is a function in JS, a class is a separate type in most other languages. I don’t see a meaningful difference.

Re:Future JavaScript: what is still missing? by kitten_mittens_ on Sunday January 27, 2019 @04:32PM (#19013914)
> a class in most languages is just a group of related static functions.

In class oriented languages like C# and Java, sure. JS with ES modules has the alternative of using functions exported directly from a module.

The latter approach has the benefit of better tree shaking than the class based equivalent.