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
variableWoohoo! My first Kata! Don't overthink it guys! Think about the problem, then code! Trust me! You'll be shocked at how much you may have overthought it!
I was attempting to accomplish this Kata without using a for loop, but cant seem to think of another way of doing it. After giving the for loop a go I keep running into the error "TypeError: 0 is not iterable" now im assuming that this has something to do with my loop, but i cant seem to see where i went wrong. Any guidance on where i might have messed up would be great, and if maybe you could give me another possible route to take to accomplish a correct answer without using a for loop would be awesome. Thanks for any help
Awesome man thanks for your help.
Your 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.Hello, I keep running into this problem (expected 'found the needle at position 5' to equal 'found the needle at position 3') Im unsure where I went wrong. According to my code this would be the correct answer. Any guidance?