concat
Merge many collections together into a DefineList.
list.concat(...listN)
Returns a DefineList
with the list
's items merged with the Arrays and lists
passed as arguments.
import {DefineList} from "can";
const list = new DefineList(["a","b"]);
const result = list.concat(
[1,2],
new DefineList(["X","Y"]),
{value: "Z"}
);
console.log( result.serialize() );
//-> ["a", "b", 1, 2, "X", "Y", {value: "Z"}]
Parameters
- listN
{Array|can-define/list/list}
:Any number of arrays, Lists, or values to add in For each parameter given, if it is an Array or a DefineList, each of its elements will be added to the end of the concatenated DefineList. Otherwise, the parameter itself will be added.