I have implemented the following binary search method for finding the position of n in a sorted array.
n
Array.prototype.binarySearch = function(n) {