Check if a Number is Odd or Even using Bitwise Operators | Returns true if n is even , else odd ; n ^ 1 is n + 1 , then even , else odd ; Driver code
function isEven ( n ) { if ( n ^ 1 == n + 1 ) return true ; else return false ; } let n = 100 ; isEven ( n ) ? document . write ( " " ) : document . write ( " " ) ;