Changes

Jump to: navigation, search

Advanced Ruby Arrays

16 bytes added, 01:53, 27 November 2007
Push and Popping Array Elements
</pre>
== Push Pushing and Popping Array Elements ==
An array in Ruby can be treated as a last in first out Last In First Out stack where items are ''pushed'' onto and ''popped'' off the array. This is achieved , unsurprisingly, using the ''push'' and ''pop'' methods.
For example we can create an array and then push elements onto it:
</pre>
Note how the elements are popped out of the array, starting with the last to be pushed onto it. Hence the term ''Last In First Out'' (LILOLIFO).
== Ruby Array Comparisons ==

Navigation menu