5 ms·
I guess you mean the opposite hasn't prevented Ruby from being popular. All numeric values are truthy, including 0.
by scotth 15y ago
I guess you mean the opposite hasn't prevented Ruby from being popular. All numeric values are truthy, including 0.
- koenigdavidmj 15y agoA lot of Ruby idiomatic methods will return either a value or nil, which is falsey, so things like: x = meep if x # do stuff end will run as most might mean.
- pyre 15y ago> I guess you mean the opposite hasn't > prevented Ruby from being popular. I was stating something more like "the fact that there is a hard split between numbers and booleans, and everything -- barring null -- by default evaluates to true." Since everything is a object instance in Ruby, asserting a variable is basically only evaluating whether or not it is null.