How can I call a javascript class from a string? Is that possible at all? One solution I didn't find that good was to store the initialization of the classes in an array and then address the object via the key. But are there other possibilities?
What I want
const classNameAsString = "HelloWorld";
class HelloWorld {
constructor() {
console.log("Hello World")
}
}
const hW = new ${classNameAsString}(); // that is wrong and would throw an error