UNPKG

@extra-array/remove-update

Version:
52 lines (38 loc) 1.49 kB
Removes value at index. [:package:](https://www.npmjs.com/package/@extra-array/remove-update) [:smiley_cat:](https://github.com/orgs/nodef/packages?repo_name=extra-array) [:running:](https://npm.runkit.com/@extra-array/remove-update) [:vhs:](https://asciinema.org/a/339804) [:moon:](https://www.npmjs.com/package/@extra-array/remove-update.min) [:scroll:](https://unpkg.com/@extra-array/remove-update/) [: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 (updated) // i: index // → x ``` ```javascript const array = require("extra-array"); var x = [1, 2, 3, 4, 5]; array.remove$(x, 2); // [ 1, 2, 4, 5 ] x; // [ 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$