Use Range.new to create a range : Range.new « Range « Ruby






Use Range.new to create a range


digits = Range.new(1, 9)
digits.to_a # => [1, 2, 3, 4, 5, 6, 7, 8, 9]

 

Related examples in the same category