mirror of
https://github.com/harttle/liquidjs.git
synced 2026-10-03 09:05:14 -07:00
Created Truthy and Falsy (markdown)
@@ -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: <https://shopify.github.io/liquid/basics/truthy-and-falsy/>
|
||||||
|
|
||||||
|
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
|
||||||
Reference in New Issue
Block a user