[SOLVED] JS enters if statement scope even though not meeting true condition

Hello all,
Unsure why this is occurring. But I have an image of my code showing the variable values and the line the script is currently executing.

Nevermind, I figured out the issue. Comparing arr[i] isn’t what I should be doing there, but comparing simply i itself.

1 Like