Need help again 20/20


I dont get what they are wanting me to do on the last lesson in this section. I am very confused


Can you post the instructions and what issue you're running into for us?


We are given a for statement and asked to refactor it using the .times method:

for i in (1..3)
  puts "I'm a refactoring master!"

We learned earlier that .times takes a parameter, a counting number, or positive integer, and applies it to a block in which we write a statement to execute on each iteration.

3.times {puts "I'm a refactoring master!"}

And that's it.


Let's finish up by refactoring the for loop on the right to use .times instead.
and the code is
for i in (1..3)
puts "I'm a refactoring master!"
but i am very confused because i don't remember working on it @lolman


oh really i had totally forgot about that thank you


It is covered in lesson 13, of Loops & Iterators

     3.times do
       puts "I'm a refactoring master!"


All these codes in 3 lines can be put together into a single!!!