is-plain-object
isPlainObject(obj)
Attempts to determine if an object is a plain object like those you would create using the curly braces syntax: {}
. The following are not plain objects:
- Objects with prototypes (created using the
new
keyword). - Booleans.
- Numbers.
- NaN.
var isPlainObject = require("can-util/js/is-plain-object/is-plain-object");
// Created with {}
console.log(isPlainObject({})); // -> true
// new Object
console.log(isPlainObject(new Object())); // -> true
// Custom object
var Ctr = function(){};
var obj = new Ctr();
console.log(isPlainObject(obj)); // -> false
Parameters
- obj
{Object}
:
Returns
{Boolean}
: