DEV Community

Discussion on: The Revealing Module Pattern in JavaScript

Collapse
 
pavelloz profile image
Paweł Kowalski

Im pretty sure es6 class doesnt have to be instantiated to do some of those things.

IE.

class Test {
  static hello() { console.log('world'); }
}

Test.hello(); // => 'world'
Thread Thread
 
brunnerlivio profile image
Livio Brunner

I think you are referring to:

ES6 classes since they need to be instantiated

I was not referring to static classes here :) I thought it would be clear with the rest of my comment.

Thread Thread
 
pavelloz profile image
Paweł Kowalski

Well, class is not static, it just has static methods on it, you can still do everything you do with any other class, plus you can run methods directly, which in combination gives a lot of flexibility.