Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
The code will not work correctly for double digit scores. But this particular kata only tests for scores from 0 to 4 on each side.
AHH so we did not have to convert the array of strings into an array of numbers. D'oh.
For this specific instance, its completely arbitrary. Doesn't make one difference.
There is a difference if you are wondering though. In the solution, he uses a pre-increment rather than a post increment like in your question. It increments the number before the statement executes. It doesn't make a difference because the only thing in that statement is '++i'. Here's an example of it:
FUN FACT: There is another difference but I'm not sure it applies to Javascript, but in C++ my professor once told me that, in a for-loop, pre-increments are much more efficient, and that big data companies always use pre-increments when applicable because of that. Could be the reason why its used here, I know I use it because of that fact lol.
why is it ++i and not i++
Noice
Nothing will happen. Read the description.
What will happen if one of point be more than 10?