Towards the end of the code, i don’t understand why arr.length is being returned
**Your code so far**
function getIndexToIns(arr, num) {
arr.sort((a, b)=> a-b);
for (let i = 0; i < arr.length; i++){
if (arr[i]>= num){
return i
}
}
return arr.length
}
getIndexToIns([40, 60], 50);
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0