diff --git a/Truthy-and-Falsy.md b/Truthy-and-Falsy.md new file mode 100644 index 0000000..44acbb7 --- /dev/null +++ b/Truthy-and-Falsy.md @@ -0,0 +1,22 @@ +Though [shopify-liquid][sl] is designed platform-independent, there're certain differences with [the Ruby version][ruby], one of which is the `truthy` evaluation. + +Everything other than `false` and `nil` is truthy in the ruby version, see: + +In this JavaScript version, things are slightly different: + +value | truthy | falsy +--- | --- | --- +`true` | ✔️ | +`false` | | ✔️ +`null` | | ✔️ +`undefined` | | ✔️ +`string` | ✔️ | +`empty string` | ✔️ | +`0` | ✔️ | +`integer` | ✔️ | +`float` | ✔️ | +`array` | ✔️ | +`empty array` | ✔️ | + +[ruby]: https://shopify.github.io/liquid +[sl]: https://www.npmjs.com/package/shopify-liquid \ No newline at end of file