Hey Jose, thanks for the feedback, really glad to see you like it!
Ah, I see what you mean. Well while there are 8 items in the array, array indexes start at 0, not 1 (it's a bit confusing at first but that's just how it is across all languages).
So to get the first item we need winningConditions[0], the second one is at winningConditions[1], etc.
What this means is that we only need the numbers 0 - 7 (8 numbers in total).
If you were to add the 'i <= 8' you'd actually get an error because you would be trying to access an element at index 0 of undefined a line under.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hey Jose, thanks for the feedback, really glad to see you like it!
Ah, I see what you mean. Well while there are 8 items in the array, array indexes start at 0, not 1 (it's a bit confusing at first but that's just how it is across all languages).
So to get the first item we need winningConditions[0], the second one is at winningConditions[1], etc.
What this means is that we only need the numbers 0 - 7 (8 numbers in total).
If you were to add the 'i <= 8' you'd actually get an error because you would be trying to access an element at index 0 of undefined a line under.