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.
Why did you have to create separate reverse function? The same could be done in Rot
It could be applied with either functions, but arrow functions always lead to cleaner code. In this solution, the num parameter was changed to length so he can just include the parameter as the length of the array instead of doing this {length: num}. Leads to cleaner code. the underscore at (_, i) basically a placeholder for the value since we don't really need a specific value from an array here.
I'm confused how this works. Can you please explain it to me? Thanks!
This comment is hidden because it contains spoiler information about the solution
Thanks for the explanation
This comment is hidden because it contains spoiler information about the solution
Why that code only work using the structure: "countSheep = length =>"?
JS: for sample tests, values passed to
Test.assertSimilar
are reversed.Thanks, cstuncsik!
In javascript
this
refers to the object you call a function on. But since a function is also an object in javascript you can dothis()
.Here
this
refers to the function you callpipe
on, so you call the original function with the arguments and pass the result to the piped function as an argument soaddOne.pipe(square)(1)
is actuallysquare(addOne(1))
wherethis
refers toaddOne
This comment is hidden because it contains spoiler information about the solution
Thanks
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 was done.
Loading more items...