Ruby - Statement until loop

Introduction

until provides the opposite functionality, looping until a certain condition is met:

Demo

x = 1 
until x > 99 # from  www . j  av a  2  s.  c o m
 puts x 
 x = x * 2 
end

Result

Related Topics