Need help again 20/20


#1

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


#2

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


#3

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!"
end

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.


#4

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!"
end
but i am very confused because i don't remember working on it @lolman


#5

oh really i had totally forgot about that thank you


#6

It is covered in lesson 13, of Loops & Iterators

https://www.codecademy.com/en/courses/ruby-beginner-en-XYcN1/2/6?curriculum_id=5059f8619189a5000201fbcb


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

#8

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