Reputation: 11
I was wondering if there is a function in javascript that returns the class if we add a parameter,
for example :
myClass extends someClass{
// My code here.
}
and somewhere else I could do :
let class = getClass("MyClass");
Or I should do a registering process (like putting my class in an array...).
Thanks.
Upvotes: 1
Views: 63
Reputation: 5127
If you use eval('myClass')
that will return the class, but it won't work with eval('MyClass')
Upvotes: 1