isPlainObject(test: any): test is Record<any, any>
Returns whether a value is a plain object
(an object that is created using an object literal, Object.create(null) or similar).
Rejects anything with a custom prototype or a non-object ECMAScript type.
Also rejects React elements and components
Note: if the host environment does not support Symbol, any object with a $$typeof
property is considered a React element
example
isPlainObject({ a:'test' }); //=> true
isPlainObject(moment()); //=> false
isPlainObject(<span></span>); //=> false
Parameters
test: any
The value to check
Returns test is Record<any, any>
Returns true if test is a plain object, else false.
Returns whether a value is a plain object (an object that is created using an object literal, Object.create(null) or similar). Rejects anything with a custom prototype or a non-object ECMAScript type. Also rejects React elements and components
Note: if the host environment does not support Symbol, any object with a $$typeof property is considered a React element