• function

concat can.Observe.List.prototype.concat

 

Merge many collections together into a List.

list.concat(...args)

Parameters

  1. args {Array | can.Observe.List | *}

    Any number of arrays, Lists, or values to add in For each parameter given, if it is an Array or a List, each of its elements will be added to the end of the concatenated List. Otherwise, the parameter itself will be added.

concat makes a new List with the elements of the List followed by the elements of the parameters.

var list = new can.Observe.List();
var newList = list.concat(
    'Alice',
    ['Bob', 'Charlie']),
    new can.Observe.List(['Daniel', 'Eve']),
    {f: 'Francis'}
);
newList.attr(); // ['Alice', 'Bob', 'Charlie', 'Daniel', 'Eve', {f: 'Francis'}]