Created
November 12, 2019 10:36
-
-
Save krisleech/f23c5557bca4aa8be1bd0e66a7c71fdc to your computer and use it in GitHub Desktop.
differentiating nil from nothing
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
| Nothing = Object.new | |
| result = [1,nil,2,4,nil].find(Nothing) { |i| i == nil } | |
| if result == Nothing | |
| else | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment