Skip to content

Remove

Bool Remove(Array<ObjectType> array, ObjectType? element)

System · system operation · implicitly imported

Removes the first occurrence of an element from an array.

Parameters

  • Array<ObjectType> array — The array to remove the element from.
  • ObjectType? element — The element to remove.

Returns

Bool — true if the element was found and removed.

Errors

A runtime type error if element is not compatible with the element type of array. A runtime error if element is an array (only one element can be removed at a time).

See Also