concat
Merge many collections together into a DefineList.
list.concat(...args)
Returns a DefineList
with the list
's items and the additional args
.
Parameters
- args
{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.
Use
concat
makes a new DefineList with the elements of the DefineList followed by the elements of the parameters.
var list = new DefineList();
var newList = list.concat(
'Alice',
['Bob', 'Charlie']),
new DefineList(['Daniel', 'Eve']),
{f: 'Francis'}
);
newList.get(); // ['Alice', 'Bob', 'Charlie', 'Daniel', 'Eve', {f: 'Francis'}]