while until

suggest change

A while loop executes the block while the given condition is met:

i = 0
while i < 5
  puts "Iteration ##{i}"
  i +=1
end

An until loop executes the block while the conditional is false:

i = 0
until i == 5
  puts "Iteration ##{i}"
  i +=1
end

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:


Control flow:
*while until

Table Of Contents