push
can.List.prototype.push
Add elements to the end of a list.
list.push(...elements)
push
adds elements onto the end of a List.
Parameters
-
elements
{*}
the elements to add to the List
Returns
{Number}
the new length of the List
push
adds elements onto the end of a List here is an example:If you have an array you want to concatenate to the end of the List, you can use
apply
:Events
push
causes change, add, and length events to be fired.See also
push
has a counterpart in pop, or you may be looking for unshift and its counterpart shift.