![Logo](/_astro/logo.DNC1PCTe_Z1abT04.webp)
Enter a search term above to see results...
Enter a search term above to see results...
Comparison helpers provide utilities for comparing values in templates.
Checks negation (!).
{#if not someCondition} someCondition is not true{/if}
not(a)
Checks equality (==).
{#if is valueA valueB} Values are equal{/if}
is(a, b)
Name | Type | Description |
---|---|---|
a | any | First value to compare |
b | any | Second value to compare |
boolean
- True if values are equal, false otherwise.
is(5, "5") // true
Checks inequality (!=).
{#if notEqual valueA valueB} Values are not equal{/if}
notEqual(a, b)
Name | Type | Description |
---|---|---|
a | any | First value to compare |
b | any | Second value to compare |
boolean
- True if values are not equal, false otherwise.
not(5, "6") // true
Checks strict equality (===).
{#if isExactly valueA valueB} Values are strictly equal{/if}
isExactly(a, b)
Name | Type | Description |
---|---|---|
a | any | First value to compare |
b | any | Second value to compare |
boolean
- True if values are strictly equal, false otherwise.
isExactly(5, 5) // trueisExactly(5, "5") // false
Checks strict inequality (!==).
{#if isNotExactly valueA valueB} Values are strictly not equal{/if}
isNotExactly(a, b)
Name | Type | Description |
---|---|---|
a | any | First value to compare |
b | any | Second value to compare |
boolean
- True if values are strictly not equal, false otherwise.
isNotExactly(5, "5") // true
Checks if a > b.
{#if greaterThan numberA numberB} A is greater than B{/if}
greaterThan(a, b)
Name | Type | Description |
---|---|---|
a | number | First number to compare |
b | number | Second number to compare |
boolean
- True if a is greater than b, false otherwise.
greaterThan(10, 5) // true
Checks if a < b.
{#if lessThan numberA numberB} A is less than B{/if}
lessThan(a, b)
Name | Type | Description |
---|---|---|
a | number | First number to compare |
b | number | Second number to compare |
boolean
- True if a is less than b, false otherwise.
lessThan(5, 10) // true
Checks if a >= b.
{#if greaterThanEquals numberA numberB} A is greater than or equal to B{/if}
greaterThanEquals(a, b)
Name | Type | Description |
---|---|---|
a | number | First number to compare |
b | number | Second number to compare |
boolean
- True if a is greater than or equal to b, false otherwise.
greaterThanEquals(10, 10) // true
Checks if a <= b.
{#if lessThanEquals numberA numberB} A is less than or equal to B{/if}
lessThanEquals(a, b)
Name | Type | Description |
---|---|---|
a | number | First number to compare |
b | number | Second number to compare |
boolean
- True if a is less than or equal to b, false otherwise.
lessThanEquals(5, 5) // true