Namespace: Basic:isEmpty

Basic:isEmpty

Source:

Methods

isEmpty() → {Boolean}

Check if variable(s) contain non-empty value (not undefined, null, '', 0, [], {} or an empty Set/Map).

You can supply additional non-empty values by providing an object having the key "additionalEmptyValues" as any single parameter. Multiple occurrences will be merged.

Parameters:
Name Type Attributes Description
... * <optional>
<repeatable>

add any number of variables you wish to check

Source:
Returns:
variable(s) is/are empty
Type
Boolean
Example
function set(name, value){
  if( isEmpty(fooBar) || isEmpty({'__additionalEmptyValues__' : [false, '0']}, someArray, someSet, someString, value) ){
    ...
  }
}