What are the rules for determining if an object is truthy/falsey in Scala? I've found many for other languages like Ruby, JavaScript, etc. but can't seem to find an authoritative list for Scala.
No data type in Scala coerces to Boolean
.
So... true
is truthy, and false
is falsey. No other values can be used as booleans.
It can't get simpler than that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With