JavaScript utility methods for objects

Usage no npm install needed!

<script type="module">
  import utilJsObjects from 'https://cdn.skypack.dev/@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:


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