UNPKG

@extra-array/push-update

Version:
55 lines (40 loc) 1.42 kB
Adds values to the end. [:package:](https://www.npmjs.com/package/@extra-array/push-update) [:smiley_cat:](https://github.com/orgs/nodef/packages?repo_name=extra-array) [:running:](https://npm.runkit.com/@extra-array/push-update) [:vhs:](https://asciinema.org/a/332111) [:moon:](https://www.npmjs.com/package/@extra-array/push-update.min) [:scroll:](https://unpkg.com/@extra-array/push-update/) [:newspaper:](https://nodef.github.io/extra-array/) [:blue_book:](https://github.com/nodef/extra-array/wiki/) > Alternatives: [push], [push$].<br> > Similar: [push], [pop], [shift], [unshift]. > This is part of package [extra-array]. [extra-array]: https://www.npmjs.com/package/extra-array <br> ```javascript array.push$(x, ...vs); // x: an array (updated) // vs: values to add // → x ``` ```javascript const array = require("extra-array"); var x = [1, 2]; array.push$(x, 3); // [ 1, 2, 3 ] x; // [ 1, 2, 3 ] var x = [1, 2]; array.push$(x, 3, 4); // [ 1, 2, 3, 4 ] ``` <br> <br> ## References - [Array.prototype.push: MDN web docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push) [push]: https://github.com/nodef/extra-array/wiki/push [push$]: https://github.com/nodef/extra-array/wiki/push$ [pop]: https://github.com/nodef/extra-array/wiki/pop [shift]: https://github.com/nodef/extra-array/wiki/shift [unshift]: https://github.com/nodef/extra-array/wiki/unshift