Search…
Resources
Related Links
odd
To return “true” if the number is odd
With this function, you can check whether a number is odd, i.e. not divisible by 2 without remainder. The return value is either “true” or “false”. 0 is evaluated as even, and therefore returns “false”.

Syntax

odd(number)

Return

boolean

Examples

odd(10 + 12)
Result: false
odd(10 + 13)
Result: true
odd(0)
Result: false
odd(10.2)
Result: true

See also

even which returns “true” if the number is even.
Export as PDF
Copy link