class SomeClass{}; const className='SomeClass'; const obj = (Function('return new ' + className))() alert(obj instanceof SomeClass);