What is truthy and falsy in Ruby?
Only nil and false are falsy — 0, '' and [] are all truthy. This trips up anyone arriving from JavaScript or Python. It means if list is true even for an empty list, so when you mean empty you have to say list.empty?.