```
function getIndexToIns(arr, num) {
// Find my place in this sorted array.
let sorted = arr.sort((a,b) => a - b);
console.log(sorted);
for(let x in sorted){
if(sorted[x] >= num){
return x;
}
}
return sorted.length;
}
```

I wonder If anyone can tell me why this code doesn’t work. BTW I know that a simple for loop works and just want to learn why this one does not work FCC but works on Atom. Thanks!