pop
Remove an element from the end of a DefineList.
list.pop()
pop
removes an element from the end of a DefineList.
var names = new DefineList(['Alice', 'Bob', 'Eve']);
names.pop() //-> 'Eve'
Returns
{*}
:
The element just popped off the DefineList, or undefined
if the DefineList was empty
Use
pop
is the opposite action from push:
var list = new DefineList(['Alice', 'Bob', 'Eve']);
list.pop(); // 'Eve'
list.pop(); // 'Bob'
list.pop(); // 'Alice'
list.pop(); // undefined
Events
pop
causes remove and length events to be fired if the DefineList is not empty
when it is called.
See also
pop
has its counterpart in push, or you may be
looking for unshift and its counterpart shift.