Which method of checking if a variable has been initialized is better/correct? (Assuming the variable could hold anything (string, int, object, function, etc.))
if (typeof console != "undefined") { ... }
Or better
if ((typeof console == "object") && (typeof console.profile == "function")) { console.profile(f.constructor); }
Works in all browsers