Version: v0.8.1 - Beta.  We welcome contributors & feedback.

List.pushFirst

pushFirst($item) -> self

Description

This function is like push, but it adds an item to the beginning of a List.

This function is the opposite of popFirst.

$letters = ['a', 'b']

$letters.pushFirst('X')
//= ['X', 'a', 'b']

$letters.popFirst()
//= 'X'

print($letters)
//= ['a', 'b']

See Also