@util.js/objects

0.41.3 • Public • Published

@util.js/objects

JavaScript utility methods for objects

NPM Status Travis CI Build Status

@util.js/objects is part of Util.js.

This class contains all the non-instance methods of Object in addition to:

Objects

JavaScript utility methods for objects

Kind: global class
Access: public

objects.isDefined(object) ⇒ Boolean

Returns whether the specified obj is defined (i.e., not null and not undefined).

In other words, this method returns false if and only if the object is null or undefined.

This method is useful when an expression like the following might return false when you expected true:


if (x) console.log("x is defined.");

This happens for 0, -0, NaN, false, and the empty string ("").

Kind: instance method of Objects
Returns: Boolean - true if the given object is defined or false otherwise
Access: public

Param Type Description
object * The object to check

/@util.js/objects/

    Package Sidebar

    Install

    npm i @util.js/objects

    Weekly Downloads

    19

    Version

    0.41.3

    License

    MIT

    Unpacked Size

    16 kB

    Total Files

    7

    Last publish

    Collaborators

    • creemama