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.
Use your implementation to refactor the precedent kata, that is a function getIndexedReleases() which uses myMap() instead of forEach().
What?
You want us returnwhat
in thefunction getIndexedReleases()
What?What?What?
Test.expect
makes debugging very difficultreduce
) not enforced by Submit TestsYou can't just say something is disallowed/illegal/whatever and expect solvers to blindly adhere to it in their solutions - you have to explicitly ban it either in the Preloaded section or the Test Cases (or both). Furthermore, I don't see the value in making plain array indexing illegal - it's one of the most primitive features in JavaScript and many other programming languages (it's not like a super powerful and handy built-in feature like Ruby's built-in prime checker).
And of course, just because this Kata is unnecessarily convoluted (with an unacceptably low quality of test feedback due to abuse of
Test.expect
) does NOT mean that it is challenging and therefore adds any value to this site. I've spent like half an hour trying to complete this Kata despite the appalling quality of the Kata Description and Test Cases but in the end I felt that I had learned nothing.And please, next time, come up with your own (original, creative, genuinely challenging and/or highly educational) content instead of just copy-pasting code challenges as-is from external Web sources (well, at least you gave full credit to whatever source you're using but still ...). Everyone will be a lot happier if only you actually took the time and effort to craft a proper Kata of decent quality.
Apart from what I said in earlier Katas, if you really want the solver to define his/her own
Array.prototype.filter
, you need to first undefine it in Preloaded, like such:Array.prototype.filter = undefined;
. On top of that, a few extra steps are needed to prevent the solver from re-importing the "canned"Array.prototype.filter
but I won't elaborate on such techniques here.Test.expect
instead of using appropriateTest.assertDeepEquals
Seriously, next time you post a Kata, consider whether it would actually add value to the site. What you're doing is the exact opposite.
This comment is hidden because it contains spoiler information about the solution
Do NOT use
Test.expect
for anything other than boolean assertions - it gives completely useless feedback upon failure and makes the kata extremely frustrating for the solver to complete.So much wrong with this Kata.
https://github.com/Codewars/codewars.com/wiki/Kata-Best-Practices
forEach
,map
and friends have been done to death on CW.8 kyu
beginner Kata like this one, it's good to include more test cases to prevent logically flawed and/or hardcoded solutions from passing.I would strongly suggest unpublishing this Kata (and the rest of your Series) and coming up with something much better.
If you want
forEach
to be used, it should be somehow enforced, otherwise everyone is probably going to usemap
orfor
.Object property order is unspecified,
assertDeepEquals
should be used to compare objects. It returns better error messages too.