Driver code
let A = [ 1 , 2 , 3 , 4 , 5 , 6 ] ; let P = 229 ; let L = 2 , R = 5 ; document . write ( calculateProduct ( A , L , R , P ) + " " ) ; L = 1 ; R = 3 ; document . write ( calculateProduct ( A , L , R , P ) + " " ) ;