Skip to content

Has ​

Last updated View as Markdown

You get true when an item with a matching property is found in an array, and false otherwise. The match is the same as for find.

liquid
{{ array | has: property, value }}

Example ​

Data
json
{
  "products": [
    { "title": "Hat", "available": true, "type": "Accessory" },
    { "title": "Tee", "available": false, "type": "Clothing" },
    { "title": "Cap", "available": true, "type": "Accessory" }
  ]
}
liquid
{{ products | has: 'type', 'Clothing' }}

Output

html
true