Is there a way in nodejs to instantiate class object with variable class name. I am trying the below snippet, it doesn't work though.
let className = "hello";
let object = new [className]();
EDITED I have multiple classes, out of those multiple classes I will get a subset(Array of String) as Input from another service and I have to call main function of those subset classes.
// Multiple classes = ["first", "second", ..............., "twenty"];
let subset_class_names = ["first", "three", "five"];
for (let aClass of subset_class_names) {
let object = new [aClass]();
object.main();
}