I am making a nodejs server. I have made a system where I need to dynamically load different classes. The name of the classes are in string. It looks like this:
var classname = "foo"; // this is the name of the class I want to call.
var bar = new classname //classname needs to be foo in this example.
I already tried window[classname]
but this wont work because this is nodejs so there is no window to work with.
Thank you for reading :)