Hello, I don’t like the verbosity of these two lines
years = Array.new
2003.step(Time.now.year) { |a| years << a }
I would like to populate the year array on one statement but I don’t
know how
Thanks in advance
Hello, I don’t like the verbosity of these two lines
years = Array.new
2003.step(Time.now.year) { |a| years << a }
I would like to populate the year array on one statement but I don’t
know how
Thanks in advance
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs