Truthy and Falsy

Though Liquid is platform-independent, there’re certain differences with the Ruby version, one of which is the truthy value.

The Truth Table

According to Shopify document everything other than false and nil is truthy. But in JavaScript we have a totally different type system, we have types like undefined and we don’t differentiate integer and float, thus things are slightly different:

value truthy falsy
true ✔️
false ✔️
null ✔️
undefined ✔️
string ✔️
empty string ✔️
0 ✔️
integer ✔️
float ✔️
array ✔️
empty array ✔️