This is a Ruby tree! It shows every object from the Ruby Programming Language in a tree format.

pop

        # Array.pop

(from ruby core)
---
    array.pop -> object or nil
    array.pop(n) -> new_array

---

Removes and returns trailing elements.

When no argument is given and `self` is not empty, removes and returns
the last element:
    a = [:foo, 'bar', 2]
    a.pop # => 2
    a # => [:foo, "bar"]

Returns `nil` if the array is empty.

When a non-negative Integer argument `n` is given and is in range,
removes and returns the last `n` elements in a new Array:
    a = [:foo, 'bar', 2]
    a.pop(2) # => ["bar", 2]

If `n` is positive and out of range, removes and returns all elements:
    a = [:foo, 'bar', 2]
    a.pop(50) # => [:foo, "bar", 2]

Related: #push, #shift, #unshift.



      

This is MURDOC! A Ruby documentation browser inspired by Smalltalk-80. It allows you to learn about Ruby by browsing through its class hierarchies, and see any of its methods.