Check if a value is a plain object (created by {} or new Object()) Returns false for arrays, Date, RegExp, Map, Set, class instances, etc.
The value to check
True if the value is a plain object
isPlainObject({}) // trueisPlainObject({ a: 1 }) // trueisPlainObject([]) // falseisPlainObject(new Date()) // falseisPlainObject(null) // falseisPlainObject(class Foo {}) // false Copy
isPlainObject({}) // trueisPlainObject({ a: 1 }) // trueisPlainObject([]) // falseisPlainObject(new Date()) // falseisPlainObject(null) // falseisPlainObject(class Foo {}) // false
Check if a value is a plain object (created by {} or new Object()) Returns false for arrays, Date, RegExp, Map, Set, class instances, etc.