Pike v8.1 release 6

Method Array.unshift()


Method unshift

array unshift(array list, mixed element)

Description

Does the opposite of "shift". Or the opposite of a "push", depending on how you look at it. Prepends the element to the front of the array and returns the new array.

Example

Array.unshift(({ "b", "c", "d" }), "a"); > ({ "a", "b", "c", "d" })

See also

ADT.Stack