Reputation: 525
for(var i = 0; i < 200000; i += 50){
// Do Stuff
}
The only way I can think to do it is to do the following
arr = [0,50,100,...,200000]
arr.each do |i|
// Do Stuff
end
If that is in fact the only way. How could you build that array quickly?
Upvotes: 0
Views: 55
Reputation: 3319
(0..200000).step(50) do |i|
# Do stuff
end
You can look at the full documentation.
Upvotes: 2