Larger of a ^ b or b ^ a ( a raised to power b or b raised to power a ) | Function to find the greater value ; Driver code
function findGreater ( a , b ) { var x = a * ( Math . log ( ( b ) ) ) ; var y = b * ( Math . log ( ( a ) ) ) ; if ( y > x ) { document . write ( " " ) ; } else if ( y < x ) { document . write ( " " ) ; } else { document . write ( " " ) ; } } var a = 3 , b = 5 , c = 2 , d = 4 ; findGreater ( a , b ) ; findGreater ( c , d ) ;