UNPKG

1.48 kBMarkdownView Raw
1Appends values from arrays.
2[:package:](https://www.npmjs.com/package/@extra-array/concat-update)
3[:smiley_cat:](https://github.com/orgs/nodef/packages?repo_name=extra-array)
4[:running:](https://npm.runkit.com/@extra-array/concat-update)
5[:vhs:](https://asciinema.org/a/332027)
6[:moon:](https://www.npmjs.com/package/@extra-array/concat-update.min)
7[:scroll:](https://unpkg.com/@extra-array/concat-update/)
8[:newspaper:](https://nodef.github.io/extra-array/)
9[:blue_book:](https://github.com/nodef/extra-array/wiki/)
10
11> Alternatives: [concat], [concat$].<br>
12> Similar: [concat], [join].
13
14> This is part of package [extra-array].
15
16[extra-array]: https://www.npmjs.com/package/extra-array
17
18<br>
19
20```javascript
21array.concat$(x, ...ys);
22// x: an array (updated)
23// ys: arrays to append
24// → x
25```
26
27```javascript
28const array = require("extra-array");
29
30var x = [1, 2];
31var y = [3, 4];
32array.concat$(x, y);
33// [ 1, 2, 3, 4 ]
34
35x;
36// [ 1, 2, 3, 4 ]
37
38var x = [1, 2];
39array.concat$(x, y, y);
40// [ 1, 2, 3, 4, 3, 4 ]
41```
42
43<br>
44<br>
45
46
47## References
48
49- [Array.prototype.concat: MDN web docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat)
50- [_.concat: lodash](https://lodash.com/docs/4.17.15#concat)
51- [Array.append: sugarjs](https://sugarjs.com/docs/#/Array/append)
52
53[concat]: https://github.com/nodef/extra-array/wiki/concat
54[concat$]: https://github.com/nodef/extra-array/wiki/concat$
55[join]: https://github.com/nodef/extra-array/wiki/join