Ruby Ruby Loops Ruby Loops The Ruby Loop

Yi Zhang
Yi Zhang
3,721 Points

Ruby Loops Task 1 of 1, stuck! Help!

Hi, Could anyone help me with my code??

loop.rb
def repeat(string, times)
  fail "times must be 1 or more" if times < 1
  counter = 0
  loop do
    puts string
    counter += 1
     if counter = times
       break
  end
end