Array.remove_at

Array.remove_at

Array.remove_at

Function

Delete and return the element with the specified subscript. Negative subscripts are supported.

Syntax

Parameters

ParametersTypeRequiredDefault valueDescription
indexIntNo-1The index to delete; negative numbers count backwards from the end.

Return value

TypeDescription
Any/EmptyThe deleted element is returned when the subscript is valid, and Empty is returned when it is out of bounds.

Example

Notes

  • remove_at will modify the original array.
  • If you only need to know whether the deletion was successful, you can continue to use delete(index).