Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

remove-function

ranner19813ISC1.0.3

Install with npm

array, remove, removeAt

readme

Install with npm

$ npm i remove-function

Usage

var remove = require('remove-function');

array.remove(value);

The argument value will be removed from the array and then returned. 

array.removeAt(index);

The index of the array will be removed and then returned.

Example

var remove = require('remove-function');

-string-

var stringArray = ['a', 'b', 'c'];

stringArray.remove('a');

//['b', 'c'];

-number-

var numberArray = [0, 1, 2, 3];

stringArray.remove(1);

//[0, 2, 3];

-removeAt-

var numberArray = [1, 2, 3];

stringArray.removeAt(0);

//[2, 3];

Author

Ran Crump