How can I offset this array so it only outputs every ten numbers?
(0...40)
[10,20,30,40]
Use the step
method for this:
10.step(40,10)
The first argument is the number you want to count up to, with the second argument being the "steps" that you take to get there.