https://github.com/writetome51/array-remove-by-index
Removes single item from array, identified by a passed index
https://github.com/writetome51/array-remove-by-index
array-manipulations item javascript remove typescript
Last synced: about 1 month ago
JSON representation
Removes single item from array, identified by a passed index
- Host: GitHub
- URL: https://github.com/writetome51/array-remove-by-index
- Owner: writetome51
- License: mit
- Created: 2018-11-01T06:08:57.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2021-11-15T03:37:20.000Z (over 4 years ago)
- Last Synced: 2025-02-02T08:32:15.011Z (over 1 year ago)
- Topics: array-manipulations, item, javascript, remove, typescript
- Language: JavaScript
- Size: 13.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# removeByIndex(index, array): void
Removes item, identified by `index`, from `array`.
`index` can be negative or positive.
Examples:
```js
let arr = [1,2,3,4,5,6];
removeByIndex(2, arr); // arr is now [1,2,4,5,6]
arr = [1,2,3,4,5,6];
removeByIndex(-2, arr); // arr is now [1,2,3,4,6]
```
## Installation
`npm i @writetome51/array-remove-by-index`
## Loading
```js
import {removeByIndex} from '@writetome51/array-remove-by-index';
```