Currently in ES5 many of us are using the following pattern in frameworks to create classes and class variables, which is comfy:
Well, you can declare variables inside the Constructor.
class Foo { constructor() { var name = "foo" this.method = function() { return name } } } var foo = new Foo() foo.method()