Basic JavaScript - Nesting For Loops

yes i<arr[i] like this

You can write syntax that compares a number and an array, but that comparison is meaningless. What does “j is less than [1, 2, 3]`” mean? It doesn’t have any logically consistent meaning. You do not want to compare a number and an array.

Look at a different way

Why did you write arr.length here instead of arr?

ahhh I understand what’s wrong, thank you

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.