Skip to content

Instantly share code, notes, and snippets.

@dentarg
Last active June 16, 2018 16:34
Show Gist options
  • Select an option

  • Save dentarg/b38b269a68b9c44d426c4652bd931791 to your computer and use it in GitHub Desktop.

Select an option

Save dentarg/b38b269a68b9c44d426c4652bd931791 to your computer and use it in GitHub Desktop.
nil smyger sig på
irb(main):001:0> foo
NameError: undefined local variable or method `foo' for main:Object
from (irb):1
from /Users/dentarg/.rubies/ruby-2.2.10/bin/irb:11:in `<main>'
irb(main):002:0> if false ; foo = 1 ; end
=> nil
irb(main):003:0> foo
=> nil
irb(main):004:0> bar
NameError: undefined local variable or method `bar' for main:Object
from (irb):4
from /Users/dentarg/.rubies/ruby-2.2.10/bin/irb:11:in `<main>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment