Ad
  • Custom User Avatar

    Use your implementation to refactor the precedent kata, that is a function getIndexedReleases() which uses myMap() instead of forEach().

    What? You want us return what in the function getIndexedReleases()

    What?What?What?

  • Custom User Avatar
    1. Abuse of Test.expect makes debugging very difficult
    2. Insufficient code coverage (3 fixed assertions is not enough)
    3. Lack of random tests
    4. Constraints described in Kata Description (e.g. use of reduce) not enforced by Submit Tests
  • Custom User Avatar

    Important note: for the sake of this exercice, please refrain from using indexers. In other words, this is illegal: <code_example>

    You 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.

  • Custom User Avatar

    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.

  • Custom User Avatar
    1. Wrong initial solution name.
    2. Initial solution has wrong number of arguments.
    3. This time there aren't even Sample Tests for the solver to carry out his/her own tests.
    4. Abuse of Test.expect instead of using appropriate Test.assertDeepEquals
    5. Too few fixed tests - very poor code coverage
    6. No random tests

    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.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    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.

  • Custom User Avatar

    So much wrong with this Kata.

    https://github.com/Codewars/codewars.com/wiki/Kata-Best-Practices

    1. Make sure content is new. forEach, map and friends have been done to death on CW.
    2. Testing - include fixed tests with full coverage of common cases and any corner cases ... Two assertions do NOT qualify as "full coverage".
    3. Testing - add random tests. Although it is not a hard requirement for 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.

  • Default User Avatar

    If you want forEach to be used, it should be somehow enforced, otherwise everyone is probably going to use map or for.

  • Default User Avatar

    Object property order is unspecified, assertDeepEquals should be used to compare objects. It returns better error messages too.