— 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
— For static, that is not something I expected. It seems I know less about class syntax in JS than I thought I did
Message permanent page
—
function MyClass() {
}
var myInstance = new MyClass();
MyClass.prototype.foo = () => 'bar';
myInstance.foo(); // 'bar'
Message permanent page
— All this works in runtime
— Class syntax is just sugar over this stuff
— This is how you did classes in ES5 btw