$.isPlainObject demo
by queryj
JavaScript
$(function () {
var a = {};
var b = $.isPlainObject(a);
console.log(b);
var c = null;
b = $.isPlainObject(c);
console.log(b);
a = {
name: "jack",
location: "maryland",
contact: {
phone: 2403012022,
fax: 2402023001,
email: {
userName: "jack",
domain: "nih.gov"
}
}
};
b = $.isPlainObject(a);
console.log(b);
console.log($.isPlainObject("a string literal"));
console.log($.isPlainObject(undefined));
console.log($.isPlainObject(1));
console.log($.isPlainObject(NaN));
});