%dw 2.0
output application/json
---
{ "isOdd" : [ isOdd(0), isOdd(1), isOdd(2+2) ] }
DataWeave
isOdd
isOdd(number: Number): Boolean
Returns true
if the number or numeric result of a mathematical operation is
odd, false
if not.
Parameters
Name | Description |
---|---|
|
A number to evaluate. |
Example
This example indicates whether the numbers are odd.
Source
Output
{ "isOdd": [ false, true, false ] }
JSON