Created
April 28, 2015 23:00
-
-
Save tylerritchie/b80c22b566bb7cc2c0ed to your computer and use it in GitHub Desktop.
wat.rb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| defined? foo | |
| #=> nil | |
| if false | |
| foo = 1 | |
| end | |
| defined? foo | |
| # => "local-variable" | |
| foo | |
| # => nil | |
| #see also: http://seejohncode.com/2012/07/31/ruby-gotcha-single-line-conditionals/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment