3 ms·
Hmm, I understand how 0 can evaluate to true (it's non-nil, non-false), but how is "not 1" false too, if 1 is true?
by StavrosK 14y ago
Hmm, I understand how 0 can evaluate to true (it's non-nil, non-false), but how is "not 1" false too, if 1 is true?
- vor_ 14y agoThe only things that evaluate to false are nil and false, so applying the "not" operator to a true value (non-nil, non-false) will evaluate to false. Hence, "not 1" is false, as is "not 0".