二进制搜索被彻底改造

我正在执行二进制搜索,并且下面的代码正确,请告诉我,如果我在进行二进制搜索算法方面做得如此出色。

let number = [1,33,350,3,9,4,5,1,2,3,9]


function srch(list,num){
 if(list.includes(num))
   return `found ${num} booska ${list.indexOf(num)} also found it at ${list.lastIndexOf(num)}`

    return `numberka ${num} not found in ${list}`

 }

 console.log(srch(number,1))
评论