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.
any use of filter could generally be made better by passing a third parameter to filter and using that for comparison, which would compare to the new copy rather than comparing to the parameter of function.
This is great! But it would not work correctly if the first element of the array
iterable
wasundefined
.Literally, since the variable is iterable, it is never a number.
.
This is not gonna work for a number
very elegant solution here. And quite readble, I think.
I don't have much deep knowledge about this topic, but... I feel like this code runs 2 diffirent loops? One of them for creating the array from the argument, one of them for the filter method? I am told that this is not a good practice, especially for longer arguments because it takes lots of resources from the computer. But... I always feel like this is more elegant solution.
Nice
somebody explain it to me pls
Knew there was a one line solution for this! Totally forogt about the ellipsis operator.
the largest annoyance with this kata was the input of both a string and a number array. the spread operator was quite a clever solution to solve that caveat.
you are always going to want to retain the first value in the iterable, so it does not matter that that comparison will always evaluate to true.
I'm surprised nobody is saying this!!!!! When i = 0, iterable[i-1] literally returns undefined!!
nice this is a cool way to do it
its work nice
Loading more items...