0
Explain Boolean, truthy, and Falsey?? Break it down for me please.
?when would I use this? What is it? strictly integers or nahh? LAMENS TERMS PLZ
6 Respuestas
+ 11
see complete description with examples here :
https://www.thoughtco.com/boolean-operators-2907909
+ 8
Like other programming language Ruby also have booleans data type for condition checking In Ruby only false and nil are falsey. Everything else is truthy (yes, even 0 is truthy).
+ 7
condition checking here means using logical operators && , || , !
for example:
4 && 5 # This returns 5
nil && true # This returns nil
true && nil # This returns nil
true || nil # This returns true
nil || "" # This returns ""
0
what does condition checking mean?? when will I use it or when would it come up??
0
you just may have confused me more..ok so... anything dwtermined falsely or nil is valued less than 0. so -1 is falsely?? do logical operators vary from language to language
0
word.. that helped a lot. Preeeci8tit.