Ad
  • Custom User Avatar

    Thanks for the feedback.
    I just removed all the date functions and it passed.

  • Custom User Avatar

    Thanks. This answers my question.
    One more thing... Can you please try again and make sure your solution works in under 500ms?

  • Custom User Avatar

    I don't think you understood my question.
    I'm wondering what exactly is limited to 500ms.
    Is it the whole test suite of a few thousand tests?

  • Custom User Avatar

    Can you clarify this?
    "12 seconds is too long :] So, in this kata, the time limit is 0.5 seconds(500ms)."
    For what? I guess it's for a number of executions.

  • Custom User Avatar

    I can't see (un-flag) your response

  • Custom User Avatar

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

  • Custom User Avatar

    If anybody wants to run the code in browser and use the debugger, here's a Chrome Extension to help you
    https://github.com/bojan88/Codewars-JavaScript-debugger

  • Custom User Avatar

    They are arrays, but with extra methods which are ignored when assertSimilar arguments are arrays.
    When you pass an object containing magicArray to assertSimilar, those extra methods from fn object are not ignored
    Here is the fail message:

    Expected: '{ pass: [ \'a\', \'b\', \'c\' ], fail: [ 1, 2, 3 ] }', instead got: '{ pass: \n  [ \'a\',\n     \'b\',\n     \'c\',\n     getFiltered: [Function: getFiltered],\n     getRejected: [Function: getRejected],\n     getSplit: [Function: getSplit],\n     count: [Function: count],\n     double: [Function: double],\n     multiply: [Function: multiply],\n     first: [Function: first],\n     last: [Function: last],\n     eq: [Function: eq] ],\n  fail: \n   [ 1,\n     2,\n     3,\n     getFiltered: [Function: getFiltered],\n     getRejected: [Function: getRejected],\n     getSplit: [Function: getSplit],\n     count: [Function: count],\n     double: [Function: double],\n     multiply: [Function: multiply],\n     first: [Function: first],\n     last: [Function: last],\n     eq: [Function: eq] ] }
    '```
    
  • Custom User Avatar

    I can't get passed "getSplit" test. My split object looks like this:

    {pass: magicArray, fail: magicArray}

    Am I missing something or the tests have issues?
    I can see that when instance of magicArray is compared with instance of Array, the test suite is creating strings which contain only array elements and then comparing those strings.
    When comparing objects with magicArrays, it's creating a string out of object and not checking if properties are arrays.

  • Custom User Avatar

    I'm getting the same error on some tests.