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.
.
In the description says that the team always plays 10 matches, but is secure to use a loop.
This comment is hidden because it contains spoiler information about the solution
A loop is required, simply because you don't know how long the arraygames
is. A solution without a loop isn't possible.Edit: Since there are always 10 games, you don't need a loop.
The error comes from this line:
let [i] = 0
, which tries to handle 0 as if it were an array. You should uselet i = 0
instead.Here are a few tips:
games
variableYour function needs to accept an argument, which you then work with.
It should look like this:
Currently, your function just does the same thing over and over again and is ignoring the input. You need to use the argument instead of your
position
array.