is

Conditional statement to check the type of a variable

1
2
3
{{#is [variable] [type]}}
...
{{/is}}
Example
format JSON XML
HTML
1
2
3
4
5
{
"Product": {
"price": 50.2
}
}
Code
1
2
3
{{#is Product.price "number"}}
This is a number
{{/is}}
Result
HTML
1
<Product price=50.2></Product>
Code
1
2
3
{{#is Product.price "number"}}
This is a number
{{/is}}
Result

Params

1
2
3
4
{{#is
variable
"type"
}}

Types

typearray
boolean
false
true
date
number
decimal
integer
odd
even
object
string
base64
hex
regexp