0.1.2 • Published 4 years ago
@geronimus/is-object v0.1.2
isObject( value )
Returns true if - and only if - the referenced value's type is "object", and it is not the value null.
Be aware that Arrays will return true because their type resolves to "object".
Examples
const isObject = require( "@geronimus/is-object" );
isObject( undefined ); // => false
isObject( null ); // => false
isObject( 1 ); // => false
isObject( true ); // => false
isObject( "object" ); // => false
isObject( {} ); // => true
isObject( [] ); // => true
isObject( new Date() ); // => trueParameters
value any
The value that you want to identify as an "object".
Notes
- An Array will return
truebecause it behaves as an object. - Although
typeof nullresolves to"object",nullreturnsfalsebecause it does not behave like an object. (eg, It does not have, and cannot have, any properties.)