is

Reports whether the value equals any one of the given candidates, a compact way to write an 'is this one of these' test in a template.

Comparison is exact on type, so the number 5 does not match the string "5".

InputArgumentsReturnsany...anybool
Source
BasicSource

Reports whether the value equals any one of the given candidates.

Given

{"status": "pending"}

Template

{{ status | is:'active','pending' }}

Result

true
No matchSource

Returns false when the value equals none of the candidates.

Given

{"status": "archived"}

Template

{{ status | is:'active','pending' }}

Result

false
SingleSource

Tests the value against a single candidate.

Given

{"role": "admin"}

Template

{{ role | is:'admin' }}

Result

true