# ISEMPTY

**The function ISEMPTY returns TRUE if the given object, string, or list is empty.**

This function takes an object, string, phone, email or list as input. It outputs a boolean indicating whether the given object, string, or list is empty: **TRUE** means that it is empty, **FALSE** means that it is not. It can also accept NULL as input, in which case it will return **TRUE**.

#### Declaration

```javascript
ISEMPTY(var) -> bool
```

&#x20;

#### Parameters

**var** (type: _object | string | array | NULL_) Any object, string, or list. It will also accept a lack of value, or NULL, as valid input.

#### Return Values

**bool** (type: _boolean_) A boolean indicating if **var** is empty. It will output **TRUE** if it is empty and FALSE otherwise.

#### Examples

In practice, input fed into the ISEMPTY function is very rarely hardcoded; there is no real need to use software to check if an object, string, or array is empty after just typing it. However, for the sake of clarity, the following examples will use hardcoded input in order to demonstrate what ISEMPTY will output given certain types of input.

The first example checks to see if an empty list is empty; that is, if the empty list does not contain any items. It does not:

```javascript
ISEMPTY([]) -> TRUE
```

The following example checks to see if a blank string is empty; that is, if the blank string does not contain any characters. It does not:

```javascript
ISEMPTY("") -> TRUE
```

The following example checks to see if a list containing a single blank string is empty. This list does not count as empty – it contains an item, even that item is only a single blank string:

```javascript
ISEMPTY([""]) -> FALSE
```

The following example checks to see if an object containing no name-value pairs is empty. The complete lack of name-value pairs makes this object empty by definition:

```javascript
ISEMPTY({}) -> TRUE
```

The following example checks to see if an object containing a single name-value pair – in which the name and the value are both blank strings – is empty. While the name and value are both blank strings, their existence means that the object contains name-value pair, and thus the object doesn't count as empty:

```javascript
ISEMPTY({"": ""}) -> FALSE
```

The last example checks if NULL – the lack of any value – is empty. For the purposes of the ISEMPTY function, lack of any value counts as empty:

```javascript
ISEMPTY(NULL) -> TRUE
```

&#x20;

#### Discussion

The ISEMPTY function can be considered the opposite of the [ISNOTEMPTY](isnotempty) function: they check for the same thing, but ISNOTEMPTY returns **FALSE** when ISEMPTY would return **TRUE** and visa versa.
