My question is about ECMAScript 2015 javascript classes.
When I create a new class :
class MyRandomClass {
constructor() {...}
}
I'd like to access the class constructor I just defined from its name, like I would do with a function :
var myClass = window['MyRandomClass'];
But it does not work, since the class constructor is not stored in the global window object.
Does anyone know how I could get the constructor from its name ?
I don't want to use a regular function as a class.
Using window.MyRandomClass = MyRandomClass
does not suit my needs either.
Thanks a lot.