在已排序的數組中查找項。 Parameters: array (Array) 要搜索的已排序數組。 itemToFind (*) 要在數組中查找的項。 comparator (binarySearch~Comparator) 用于將項與數組中的元素進行比較的函數。 Example // Create a comparator function to search through an array of numbers. function comparator(a, b) { return a - b; }; var numbers = [0, 2, 4, 6, 8]; var index = bmgl.binarySearch(numbers, 6, comparator); // 3