Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
138
rated 0 times [  140] [ 2]  / answers: 1 / hits: 34040  / 14 Years ago, tue, november 30, 2010, 12:00:00

I am defining a class in javascript using this...



// 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


How can I do this?



Regards


More From » javascript

 Answers
287
if (typeof class_a === 'function')

[#94792] Saturday, November 27, 2010, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
lizet

Total Points: 479
Total Questions: 96
Total Answers: 113

Location: Mexico
Member since Sun, Jul 25, 2021
3 Years ago
;