我用javascript在javascript中定义了一个类...
// file_a.js
function class_a() {
this.prop1 = null;
this.prop2 = null;
}
// file_b.js
var obj = new class_a;
// I need to check here if class_a exists
Run Code Online (Sandbox Code Playgroud)
我怎样才能做到这一点?
问候
Que*_*tin 47
if (typeof class_a === 'function')
Run Code Online (Sandbox Code Playgroud)