Get three out of five : take « Range « Ruby






Get three out of five

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

 

Related examples in the same category