1function evenOrOdd(num) { //for string length take string
2 if (num % 2 == 0) {//and replace numm with string.length here
3 return "even";
4 } else {
5 return "odd";
6 }
7}
1<!DOCTYPE html>
2<html>
3<body>
4<script>
5 var num = 5;
6 document.write("Number = "+num+"<br>");
7 if(num % 2 == 0) {
8 document.write('Number is even!');
9 } else {
10 document.write('Number is odd!');
11 }
12</script>
13</body>
14</html>