if odd js
function isEven(value) {
return !(value % 2)
}
if odd js
function isEven(value) {
return !(value % 2)
}
number is even or odd fucntion in javascript
<!DOCTYPE html>
<html>
<body>
<script>
var num = 5;
document.write("Number = "+num+"<br>");
if(num % 2 == 0) {
document.write('Number is even!');
} else {
document.write('Number is odd!');
}
</script>
</body>
</html>
Javascript Check if number is even or odd
function solution(num) {
return num % 2 === 0 ? 'Even' : 'Odd'
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us