Skip to content

Instantly share code, notes, and snippets.

@aaronblohowiak
Created February 24, 2010 01:05
Show Gist options
  • Save aaronblohowiak/312942 to your computer and use it in GitHub Desktop.
Save aaronblohowiak/312942 to your computer and use it in GitHub Desktop.
#these are different!!!
(1..10).each do |i|
if i < 5
puts i
else
break
end
end
(1..10).each do |i|
break if i >= 5
puts i
end
#Extra credit: what does this do?
(1..10).each do |i|
i < 5 ? puts i : break
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment