Check whether product of ' n ' numbers is even or odd | function to check whether product of ' n ' numbers is even or odd ; if a single even number is found , then final product will be an even number ; product is an odd number ; Driver program to test above
function isProductEven ( arr , n ) { for ( let i = 0 ; i < n ; i ++ ) if ( ( arr [ i ] & 1 ) == 0 ) return true ; return false ; } let arr = [ 2 , 4 , 3 , 5 ] ; let n = arr . length ; if ( isProductEven ( arr , n ) ) document . write ( " " ) ; else document . write ( " " ) ;