Multiples of 4 ( An Interesting Method ) | Returns true if n is a multiple of 4. ; Printing multiples of 4 using above method
function isMultipleOf4 ( n ) { if ( n == 0 ) return true ; return ( ( ( n >> 2 ) << 2 ) == n ) ; } for ( let n = 0 ; n <= 42 ; n ++ ) if ( isMultipleOf4 ( n ) ) document . write ( n + " " ) ;