Can anyone point me to some code to determine if a number in JavaScript is even or odd?
By using ternary operator, you we can find the odd even numbers:
var num = 2; result = (num % 2 == 0) ? 'even' : 'odd' console.log(result);