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 for loop is faster because it directly iterates through the array without creating additional copies of the data. Unlike methods like filter() or reduce(), the for loop avoids the overhead of functional callbacks and intermediate array creation, resulting in better performance and lower memory usage, especially for large inputs.
Oh, thank you. Now it makes sence for me
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
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.
Loading more items...