Tell us what’s happening:
Your code so far
function getIndexToIns(arr, num) {
arr = Array.sort();
for (var i = 0; i < arr.length; i++) {
if (num <= arr[i]) {
return arr[i][0];
}
}
return arr.length;
}
getIndexToIns([40, 60], 50);
Your browser information:
Your Browser User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36
.
Link to the challenge:
https://www.freecodecamp.org/challenges/where-do-i-belong