Just wondering how to test that a prototype is available based on its name.
For instance:
var node = new window[className];
console.log('test');
doesn’t print anything if the className provided doesn’t match a prototype that’s been made available.
So testing:
if(! window[className]) {...}
make nothing to happen, the execution just stops, no breakpoint available past that point.
How can I handle this case?
Thanks!
If you want something to happen when
classNameis not available, just use a simpleelsestatement: