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