For...of vs. for...in

i isn’t an index. It is the value itself. So your if is trying to check if(arr[7]), if(arr['ate']), etc.

1 Like