@geronimus/is-object

0.1.2 • Public • Published

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() ); // => true

Parameters

value any

The value that you want to identify as an "object".

Notes

  • An Array will return true because it behaves as an object.
  • Although typeof null resolves to "object", null returns false because it does not behave like an object. (eg, It does not have, and cannot have, any properties.)

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.2
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.2
    0
  • 0.1.1
    0
  • 0.1.0
    0

Package Sidebar

Install

npm i @geronimus/is-object

Weekly Downloads

0

Version

0.1.2

License

BSD-2-Clause

Unpacked Size

3.19 kB

Total Files

4

Last publish

Collaborators

  • geronimus