Skip to content

Instantly share code, notes, and snippets.

@bradleybuda
Created January 20, 2010 02:02
Show Gist options
  • Save bradleybuda/281519 to your computer and use it in GitHub Desktop.
Save bradleybuda/281519 to your computer and use it in GitHub Desktop.
if true
foo = 1
else
bar = 2
end
puts foo.inspect # output is "1"
puts bar.inspect # output is "nil" - bar is defined even though the if statement always fails
puts baz.inspect # raises NameError
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment