I’m currently learning Ruby and I saw this declaration:
the_count = [1, 2, 3, 4, 5]
However, I feel there is a smarter way to declare this array with a pre-existing function. I’m wondering if there’s a term for this particular array with the contents ascending by 1 as its index ascends by 1.
Thanks in advance!
Use a range.
…or…
…or…
(thanks to Meagar.)