We have an array and we need to print the double of each item in the array.
We can do it in so many ways.
First let’s see two different styles of using
We can also use the “for loop” a bit differently as shown below.
Using each is the best way
“for loops” are used a lot.
However in Ruby the most preferred way of iterating
through items in an array is by using