unshift
Add elements to the start of an observe array.
list.unshift(...elements)
unshift
adds elements onto the start of an observe array.
import { observe } from "can/everything";
const names = new observe.Array(['Alice', 'Bob']);
names.unshift('Chris');
console.log(names); //-> ['Chris', 'Alice', 'Bob']
Parameters
- elements
{*}
:the elements to add to the Array
Returns
{Number}
:
the new length of the Array
Events
unshift
causes length events to be fired.