Skip to content

Instantly share code, notes, and snippets.

@tatey
Created May 27, 2009 04:52
Show Gist options
  • Save tatey/118470 to your computer and use it in GitHub Desktop.
Save tatey/118470 to your computer and use it in GitHub Desktop.
for i in (1..10).to_a do
x = i
end
puts x #=> 10
(1..10).to_a.each do |i|
y = i
end
puts y #=> undefined local variable or method `y' for main:Object (NameError)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment