Driver program Let us search 3 in below array
let arr = [ 5 , 6 , 7 , 8 , 9 , 10 ] ; let n , key ; n = arr . length ; key = 10 ; document . write ( " " + binarySearch ( arr , 0 , n - 1 , key ) + " " ) ;