js odd even number code example
Example 1: check if number is even javascript
if ( num % 2 == 0) {
alert('Even Number');
}else{
alert('Odd Number');
}
Example 2: if odd js
function isEven(value) {
return !(value % 2)
}
Example 3: log odd numbers js
for(var n = 0; n <= 10; n+=2) console.log(n)