Comment on New to Ruby? Tips for the new Rubyist.Comments−snorkel14yEmpty string is true. Who here hasn't banged their head over that one?−getsat14yIt's probably better to think "everything that isn't nil or false is true".−xentronium14y0 is true too. I think that's actually brilliant. [1,2,3].index(1) # => 0 [1,2,3].index(4) # => nil
Comments
Empty string is true. Who here hasn't banged their head over that one?
It's probably better to think "everything that isn't nil or false is true".
0 is true too. I think that's actually brilliant.