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.
Nice one xD
This is bad because both of methods map and reduce are using together. And this will badly affect the performance of the code
Because its iterate through an array twice.On first iteration it square each number, on second iteration it sums all numbers.
In my opinion making function such as sum or square is also bad practice with JavaScript because you can use Math object or just normal
+
operator.Anyway this solution is still valid and very easy to read so its good for me.Cheers!
If you are still active and are getting notifications, would you mind telling me why you think this is bad? Thank you :)
He's a level 3 kyu so maybe he was just having fun with it? I know that seems shocking but people have fun with codewars.
Fixed it. Thank you.
The most efficient solutions don't sort at all.
Is that even a suggestion? ;-)
Right, I keep forgetting they are mutable there.