UNPKG

@extra-array/remove

Version:
48 lines (35 loc) 1.42 kB
Removes value at index. [:package:](https://www.npmjs.com/package/@extra-array/remove) [:smiley_cat:](https://github.com/orgs/nodef/packages?repo_name=extra-array) [:running:](https://npm.runkit.com/@extra-array/remove) [:vhs:](https://asciinema.org/a/339804) [:moon:](https://www.npmjs.com/package/@extra-array/remove.min) [:scroll:](https://unpkg.com/@extra-array/remove/) [:newspaper:](https://nodef.github.io/extra-array/) [:blue_book:](https://github.com/nodef/extra-array/wiki/) > Alternatives: [remove], [remove$], [removePath$].<br> > Similar: [get], [set], [remove]. > This is part of package [extra-array]. [extra-array]: https://www.npmjs.com/package/extra-array <br> ```javascript array.remove(x, i); // x: an array // i: index ``` ```javascript const array = require("extra-array"); var x = [1, 2, 3, 4, 5]; array.remove(x, 2); // [ 1, 2, 4, 5 ] ``` <br> <br> ## References - [Array.prototype.splice: MDN web docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice) - [immutable-iterable-prototype: @azu](https://github.com/azu/immutable-iterable-prototype) [remove]: https://github.com/nodef/extra-array/wiki/remove [remove$]: https://github.com/nodef/extra-array/wiki/remove$ [get]: https://github.com/nodef/extra-array/wiki/get [set]: https://github.com/nodef/extra-array/wiki/set [removePath$]: https://github.com/nodef/extra-array/wiki/removePath$