Quick method to help detect a variable's type
$.gettype(obj)
Object.
.base
is the basic Javascript type ("array","Date","object","NaN","null","number","string","undefined")..extended
supports user-defined class types, through the .__class_types[]
array (if present)<script src='http://eleventyone.github.io/jquery.gettype/src/jquery.gettype.js'></script>
var c = new MyClass({name:"EleventyOne",age:99,blob:null});
console.log($.gettype(c));
console.log($.gettype(c.name).base);
console.log($.gettype(c.age).base);
console.log($.gettype(c.blob).base);
console.log($.gettype(c.superhero).base);
// PRINTS:
//
// Object { base : "object", extended: "MyClass" }
// string
// number
// null
// undefined
Source of inspiration: http://stackoverflow.com/questions/7390426/better-way-to-get-type-of-a-javascript-variable/7390612#7390612
You can find the necessary files to include here: