neq

Reports numeric inequality across the int and float kinds, so 5 and 5.0 are equal and this returns false for them.

InputArgumentsReturnsfloat64float64boolstringstringboolanyanybool
Source
BasicSource

Compares numerically across the int and float kinds, so 5 and 5.0 are equal and neq reports false.

Given

{"count": 5}

Template

{{ count | neq:5.0 }}

Result

false
BasicSource

Reports inequality, the negation of eq, so a status that differs from the one named is true.

Given

{"status": "active"}

Template

{{ status | neq:'archived' }}

Result

true

Treats nil as equal only to nil, so an absent value differs from zero rather than reading as it.

Given

{}

Template

{{ missing | default:0 | neq:0 }}

Result

false