Ruby - A strange boolean operator | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 5

Ruby - A strange boolean operator

Given this code: int = 0 str = "" if int && str then puts 1 else puts 0 end why does it output 1, that is, why the "and" is true?

31st May 2019, 10:30 AM
Paolo De Nictolis
Paolo De Nictolis - avatar
2 Antworten
- 1
Hi to everyone
2nd Jun 2019, 7:03 AM
Promise