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.
I love this solution! I wouldn't have thought of using an object like that. Very cool!
Dont insult my switch case!! but i admit this one better
how is this not highest voted, but a switch case is? what.
great solution! But you could minimize work by returning false at the top of the function if walk's steps are different from 10, I think!
great use of {} but the problem is too much easy to solve it with this level of complexity.
Yup. That was my move. good show ;)
Sure. Its a quick solution; i.e deserving of clever. Best practices not so much. No need to be harsh and sarcastic friend. only trying to improve it.
What if I told you the aim was not to make a fast code but to try to resolve THIS kata as fast as possible?
Cheers.
http://i0.kym-cdn.com/entries/icons/original/000/009/889/Morpheus2.jpg
What if I told you the aim was not to make a fast code but to try to resolve THIS kata as fast as possible?
Cheers.
http://i0.kym-cdn.com/entries/icons/original/000/009/889/Morpheus2.jpg
What if I told you the aim was not to make a fast code but to try to resolve THIS kata as fast as possible?
Cheers.
http://i0.kym-cdn.com/entries/icons/original/000/009/889/Morpheus2.jpg
Because of the nature of javascript, it would be better if the 'key' object is defined before the return statement so it is not recreated for each iteration of the reduce function. It would be a very minor improvement though. =D
law78 is correct. This would cause you to iterate over the array 4 times to produce each count.