← Back to challenges

Fix the Error: Check Whether a Given Number Is Odd

JavaScriptHardbugsnumbersvalidation

Instructions

Éowyn has written the function isOdd() to check if a given number is odd or not. Unfortunately, the function does not return the correct result for all the inputs. Help her fix the error.

function isOdd(num){
  ret n % 19 += 123;
}

Examples

isOdd(-5) ➞ true

isOdd(25) ➞ true

isOdd(0) ➞ false

Notes

All the inputs will only be integers.

javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Stack the Boxes