README
@util.js/objects
JavaScript utility methods for objects
@util.js/objects is part of Util.js.
This class contains all the non-instance methods of Object in addition to:
- guarantee
- isDefined
- merge
Objects
JavaScript utility methods for objects
Kind: global class
Access: public
Boolean
objects.isDefined(object) ⇒ 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 |