Tell us what’s happening:
Describe your issue in detail here.
Most of the points are correct, but I can’t figure out where I am going wrong.
Need help!
**Your code so far**
function getIndexToIns(arr, num) {
console.log(arr.push(num))
// console.log(arr)
console.log(arr.sort())
for(let i=0; i<arr.length; i++){
// console.log(arr[i])
if(arr[i]===num){
return i;
}
}
return num;
}
getIndexToIns([40, 60], 50);
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36
Challenge: Basic Algorithm Scripting - Where do I Belong
Link to the challenge: