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