Skip to content

Instantly share code, notes, and snippets.

@omarqureshi
Created July 13, 2010 08:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save omarqureshi/b07f6a11500693a2e181 to your computer and use it in GitHub Desktop.
Save omarqureshi/b07f6a11500693a2e181 to your computer and use it in GitHub Desktop.
irb(main):001:0> for i in 1..10 do
irb(main):002:1* puts i
irb(main):003:1> end
1
2
3
4
5
6
7
8
9
10
=> 1..10
irb(main):004:0> i
=> 10
irb(main):005:0> (1..10).each do |j|
irb(main):006:1* puts j
irb(main):007:1> end
1
2
3
4
5
6
7
8
9
10
=> 1..10
irb(main):008:0> j
NameError: undefined local variable or method `j' for main:Object
from (irb):8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment