Message from JavaScript talks

June 2017

— 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(); = () => 'bar';; // 'bar'

— All this works in runtime

— Class syntax is just sugar over this stuff

— This is how you did classes in ES5 btw

— I know haha

— I didn't quite understand how it mapped to the old paradigm

— Also important to know that EVERY function is new'able

— Huh? How?

— I get a "that is not a constructor" error

— For which functions?

— Well, functions which aren't constructors :P