Parity of the given mathematical expression using given N numbers | Javascript program to determine the parity of the given mathematical expression ; Iterating through the given integers ; If any odd number is present , then S is even parity ; Else , S is odd parity ; Driver Code
function getParity ( n , A ) { for ( let x in A ) { if ( ( x & 1 ) == 1 ) { document . write ( " " ) ; return ; } } document . write ( " " ) ; } let N = 3 ; let A = [ 2 , 3 , 1 ] ; getParity ( N , A ) ;