'use strict';
class a {
constructor () {
}
}
console.log(typeof a); // function
var b = new a();
console.log(b); // a {}
console.log(typeof b); // object
Example #2 – class example
'use strict';
class MyClass {
myMethod () {
return 'Hello World';
}
}
var myClass = new MyClass();
console.log(myClass.myMethod());