1
0
Fork 0
hugo/docs/content/en/functions/go-template/or.md

528 B

title description categories keywords params
or Returns the first truthy argument. If all arguments are falsy, returns the last argument.
functions_and_methods
aliases returnType signatures
any
or VALUE...

{{% include "/_common/functions/truthy-falsy.md" %}}

{{ or 0 1 2 }} → 1
{{ or false "a" 1 }} → a
{{ or 0 true "a" }} → true

{{ or false "" 0 }} → 0
{{ or 0 "" false }} → false

{{% include "/_common/functions/go-template/text-template.md" %}}