javascript if odd code example
Example 1: if odd js
function isEven(value) {
return !(value % 2)
}
Example 2: check if even or odd javascript
function evenOrOdd(num) { //for string length take string
if (num % 2 == 0) {//and replace numm with string.length here
return "even";
} else {
return "odd";
}
}
Example 3: javascript even number
let isEven = (n) => !(n&1);