const binarySearch = (nums, target) => {
let min = 0
let max = nums.length - 1
while (min <= max) {
let mid = Math.round((min + max) / 2)
if (Object.is(target, nums[mid])) { // 找到值
return true // 已找到
} else if (target < nums[mid]) {
max = mid - 1
} else {
min = mid + 1
}
}
return false
}