Driver code
var arr = [ - 10 , - 3 , 5 , 6 , - 20 ] ; var n = arr . length ; var max = maxProduct ( arr , n ) ; if ( max == - 1 ) { document . write ( " " ) ; } else { document . write ( " " + max ) ; }