UNPKG

@extra-array/concat-update

Version:
56 lines (41 loc) 1.48 kB
Appends values from arrays. [:package:](https://www.npmjs.com/package/@extra-array/concat-update) [:smiley_cat:](https://github.com/orgs/nodef/packages?repo_name=extra-array) [:running:](https://npm.runkit.com/@extra-array/concat-update) [:vhs:](https://asciinema.org/a/332027) [:moon:](https://www.npmjs.com/package/@extra-array/concat-update.min) [:scroll:](https://unpkg.com/@extra-array/concat-update/) [:newspaper:](https://nodef.github.io/extra-array/) [:blue_book:](https://github.com/nodef/extra-array/wiki/) > Alternatives: [concat], [concat$].<br> > Similar: [concat], [join]. > This is part of package [extra-array]. [extra-array]: https://www.npmjs.com/package/extra-array <br> ```javascript array.concat$(x, ...ys); // x: an array (updated) // ys: arrays to append // → x ``` ```javascript const array = require("extra-array"); var x = [1, 2]; var y = [3, 4]; array.concat$(x, y); // [ 1, 2, 3, 4 ] x; // [ 1, 2, 3, 4 ] var x = [1, 2]; array.concat$(x, y, y); // [ 1, 2, 3, 4, 3, 4 ] ``` <br> <br> ## References - [Array.prototype.concat: MDN web docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat) - [_.concat: lodash](https://lodash.com/docs/4.17.15#concat) - [Array.append: sugarjs](https://sugarjs.com/docs/#/Array/append) [concat]: https://github.com/nodef/extra-array/wiki/concat [concat$]: https://github.com/nodef/extra-array/wiki/concat$ [join]: https://github.com/nodef/extra-array/wiki/join