Get first two from a range : first « Range « Ruby






Get first two from a range


p (1..5).first(2)      # => [1,2]

 

Related examples in the same category