default
Default returns the fallback value if the input is nil or an empty string.
Default returns the fallback value if the input is nil or an empty string.
Input
any
Parameters
| # | Type | Required |
|---|---|---|
| 0 | any | yes |
Returns
any
Examples
{{ name | default:'anonymous' }}
{{ count | default:0 }}
{{ items | find:'id',99 | default:{} }}
{{ items | find:'slug','my-item' | default:{} }}How is this guide?