4 ms·
Empty string is true. Who here hasn't banged their head over that one?
by snorkel 14y ago
Empty string is true. Who here hasn't banged their head over that one?
- getsat 14y agoIt's probably better to think "everything that isn't nil or false is true".
- xentronium 14y ago0 is true too. I think that's actually brilliant. [1,2,3].index(1) # => 0 [1,2,3].index(4) # => nil