clear

Removes all items from a list.

This function generates a change (except when called on a variable).

Function

list.clear()

Return value

Returns nil.

Example

This code adds things to a set:

arr = ['a', 'b', 'c'];

arr.clear();
arr;  // the list is empty

Return value in JSON format

[]