Skip to content

Instantly share code, notes, and snippets.

@Mikoangelo
Created August 7, 2008 13:30
Show Gist options
  • Save Mikoangelo/4399 to your computer and use it in GitHub Desktop.
Save Mikoangelo/4399 to your computer and use it in GitHub Desktop.
>> for a in [1,2,3]
>> b = a * 3
>> end
=> [1, 2, 3]
>> [a,b]
=> [3, 9]
>> [1,2,3].each do |c|
?> d = c * 3
>> end
=> [1, 2, 3]
>> c
NameError: undefined local variable or method `c' for main:Object
from (irb):8
>> d
NameError: undefined local variable or method `d' for main:Object
from (irb):9
>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment