javascript check if value is even or odd code example Example: how to check if number is even if ( n % 2 == 0 ) { // n is even } else { //otherwise odd }