ary.take(n) â new_ary
Instance Public methods
Returns first n
elements from the array.
If a negative number is given, raises an ArgumentError.
See also #drop
a = [1, 2, 3, 4, 5, 0] a.take(3) #=> [1, 2, 3]
Returns first n
elements from the array.
If a negative number is given, raises an ArgumentError.
See also #drop
a = [1, 2, 3, 4, 5, 0] a.take(3) #=> [1, 2, 3]
Please login to continue.