In Ruby, everything is an object. 0 is just an instance of Integer. Object instances are truthy, compared to say, nil. Makes more sense than ( 'b' + 'a' + + 'a' + 'a' ).toLowerCase() === "baNaNa" or 1 + '0' == '10' or NaN === Nan; // false
The global value false is the only instance of class FalseClass and represents a logically false value in boolean expressions. The class provides operators allowing false to participate correctly in logical expressions.
11
u/SleepingInsomniac 15h ago
In Ruby, everything is an object. 0 is just an instance of Integer. Object instances are truthy, compared to say, nil. Makes more sense than
( 'b' + 'a' + + 'a' + 'a' ).toLowerCase() === "baNaNa"or1 + '0' == '10'orNaN === Nan; // false