remove-at-index
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

remove-at-index

Remove an element at a specified index without modifying the original array.

Install

npm install remove-at-index

Usage

const removeAtIndex = require('remove-at-index');
 
const array = ['foo', 'bar', 'baz'];
const result = removeAtIndex(array, 0);
// result => ['bar', 'baz']
// array => ['foo', 'bar', 'baz']

API

removeAtIndex(array, i)

Removes the element at the specified index without modifying the original array.

array

Type: array (required)

The array to remove an element from. Does not mutate the array.

i

Type: number (required)

The index of the element to remove.

Readme

Keywords

Package Sidebar

Install

npm i remove-at-index

Weekly Downloads

11

Version

1.0.0

License

ISC

Unpacked Size

3.35 kB

Total Files

5

Last publish

Collaborators

  • blewisio