To repeat something, Ruby provides
us with times
. We can use the do end
block with it as shown below:
In the above example, we want
to print the same statement 10 times.
You can see that times
is a
much simpler way to do this compared
to loops or anything else.