UNPKG

@extra-array/concat

Version:
49 lines (35 loc) 1.3 kB
Appends values from arrays. [:package:](https://www.npmjs.com/package/@extra-array/concat) [:smiley_cat:](https://github.com/orgs/nodef/packages?repo_name=extra-array) [:running:](https://npm.runkit.com/@extra-array/concat) [:vhs:](https://asciinema.org/a/332028) [:moon:](https://www.npmjs.com/package/@extra-array/concat.min) [:scroll:](https://unpkg.com/@extra-array/concat/) [: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(...xs); // xs: arrays ``` ```javascript const array = require("extra-array"); var x = [1, 2]; var y = [3, 4]; array.concat(x, y); // [ 1, 2, 3, 4 ] 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) - [Array.add: sugarjs](https://sugarjs.com/docs/#/Array/add) [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