Hi everyone!
Trying to solve Where do I Belong Challenge in the Basic Algorithm Scripting section.
The code I have wrote perfectly works in this code editor: [https://eloquentjavascript.net/code/], but for some reason does not get accepted in the challenge.
Could anyone see what the problem could be?
function getIndexToIns(arr, num) {
let place;
for(var x in arr){
if (arr[x]>num) {
place=x;
break;
}
}
return place;
}
getIndexToIns([40, 60], 50);