Removes the item at the specified index from the specified items array.
index
items
Type of item in the specified items array.
Array of items containing the item to remove.
Index of the item to remove.
Copy of array with item at index removed. If the specified items array is empty, returns items.
RangeError if the specified index is out of bounds.
const values = [1, 2, 3, 4, 5, 6];const updated = removeAtIndex(values, 2);// [1, 2, 4, 5, 6] Copy
const values = [1, 2, 3, 4, 5, 6];const updated = removeAtIndex(values, 2);// [1, 2, 4, 5, 6]
Removes the item at the specified
index
from the specifieditems
array.