Answers for "how to find even and odd number in javascript"

4

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";
  }
}
Posted by: Guest on November-22-2020
0

log odd numbers js

for(var n = 0; n <= 10; n+=2) console.log(n)
Posted by: Guest on March-02-2021

Code answers related to "how to find even and odd number in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language