Driver code
let arr = [ 2 , 1 , 3 , 5 , 12 , 11 , 7 , 9 ] ; let N = arr . length ; let L = 2 ; let R = 6 ; if ( hasCrest ( arr , N , L , R ) ) document . write ( " " ) ; else document . write ( " " ) ;