Contents

Roo

Array.push()

Arrays can be used as a simple stack. This method appends the passed object to this array. Returns the amended array afterwards.

array.push(obj as Object) as Array

Parametera

  • obj. Object. The object to append to this array

Returns

  • This modified array

Example

var a = ["a", "b", "c"]
a.push("d") # => ["a", "b", "c", "d"]