rng.first â obj
rng.first(n) â an_array
rng.first(n) â an_array
Instance Public methods
Returns the first object in the range, or an array of the first
n
elements.
1 2 | ( 10 .. 20 ).first #=> 10 ( 10 .. 20 ).first( 3 ) #=> [10, 11, 12] |
Please login to continue.