Remove an element at a specified index without modifying the original array.
npm install remove-at-index
const removeAtIndex = require('remove-at-index');
const array = ['foo', 'bar', 'baz'];
const result = removeAtIndex(array, 0);
// result => ['bar', 'baz']
// array => ['foo', 'bar', 'baz']
Removes the element at the specified index without modifying the original array.
Type: array
(required)
The array to remove an element from. Does not mutate the array.
Type: number
(required)
The index of the element to remove.