Skip to content

List Compact

The list::compact function removes all null or empty values from a list.

Syntax

list::compact(<list>)

Parameters

  • list: The input list to be compacted.

Returns

  • List: A new list with all null or empty values removed.

Example

Try it out below!
list::compact([1, null, 2, "", 3])

This function is useful for cleaning up data by removing unwanted values.