Message from JavaScript talks

June 2017

— If not, that's fine

— 

As long as ALL the accessors of #priv neccessarily have to be defined within the class declaration I don't see a problem

— Hmm, not sure!

— As I understand it class is just a special function, and assigning a property to an uninstantiated class should get you the same results as assigning a property to a function definition.

Message permanent page

— Uuuh noo

— Which... I have never tried, haha

— It creates a static method

— 

class MyClass {
static myMethod () {
return 4;
}
}


equivalent to:

function MyClass() {
};

MyClass.myMethod =
function myMethod() {
return 4;
};

Message permanent page

— Except second one can run as a function (without new) as well

— That's the only difference

— Heh, static methods AND instance methods can all be changed at runtime dude

— I see