# REMOVE\_EMPTY

**The REMOVE\_EMPTY function removes all empty and `NULL` values from a given `List`.**

This function takes any `List` as input. It outputs another `List`: the given `List`, with all empty and NULL values removed.

#### Declaration

```javascript
REMOVE_EMPTY(list) -> filtered_list
```

&#x20;

#### Parameters

**list** (required, type: `List`) A `List` containing any number of items. These items can be of any type and do not need to be the same type as each other.

#### Return Values

**filtered\_list** (type: `List`) The `List` that results when all empty or `NULL` values are removed from the given `List`.

#### Examples

The following example takes a `List` of `text` types and removes all empty strings:

```javascript
REMOVE_EMPTY(
  [
    "not empty",
    "",
    "also not empty",
    "",
    "",
    "this last one isn't empty"
  ]
) 
->
[
  "not empty",
  "also not empty",
  "this last one isn't empty"
]
```

THE REMOVE\_EMPTY function can parse `Lists` that contain values of any type, and the data types of each instance within a list do not need to match. All empty `Objects`, `strings`, `Lists`, and `NULL` values will be removed:

```javascript
REMOVE_EMPTY(
  [
    {  },
    { "object": "not empty" },
    [  ],
    [
      "this",
      "List",
      "is",
      "not",
      "empty"
    ],
    "",
    "not an empty string",
    1,
    NULL
  ]
)
->
[
  {
    "object": "not empty"
  },
  [
    "this",
    "List",
    "is",
    "not",
    "empty"
  ],
  "not an empty string",
  1
]
```

Values such as the `Number` 0 or the `Boolean` **FALSE** do not count as empty values:

```javascript
REMOVE_EMPTY([ 0, FALSE ]) -> [0, FALSE]
```

The REMOVE\_EMPTY function only removes empty or NULL items from the `List` given as input. If one of items within that `List` is a `List` or `Object` that contains an empty or NULL value, the REMOVE\_EMPTY function will not remove it. For example, if the REMOVE\_EMPTY function is given a `List` with two items: an empty `List`, and a `List` containing two items: `NULL` and an empty `List`, the REMOVE\_EMPTY function will behave as follows:

```javascript
REMOVE_EMPTY([ [  ], [ NULL, [  ] ] ]) -> [ [ NULL, [  ] ] ]
```

Note that the returned `List` has only a single item, but that none of the empty or `NULL` values have been removed from it.
