isEmpty()

Determines if an array, arguments list, other type of list or collection is empty. Also can be used on objects to ensure that it doesn't have any properties explicitly set.

This function is valid in v2.1.0 to v2.14.0. This function has been downloaded 46 times.

Parameter

{*} value
Value to be checked.

Returns

{boolean}
Returns false if value is an empty array, arguments list, node list, element collection, or string. Returns false if value has no properties of its own defined. In all other cases, true is returned.

Required Functions

This function requires the following functions which are included automatically:

  • has()
    Every object descended from Object inherits the hasOwnProperty method. This method can be used to determine whether an object has the specified property as a direct property of that object; unlike the in operator, this method does not check down the object's prototype chain.
  • isArrayLike()
    Determines if an object is an array or at least array-like.