Ad
  • Default User Avatar

    Because the mind of a genius is capable of handling an unlimited amount of complexity, even it is totally uneccessary and wrong :P

  • Default User Avatar

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

  • Default User Avatar

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

  • Default User Avatar

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

  • Default User Avatar

    Can anyone please help me understand the return statement, a ternary operator in this case, which in the else clause basically calls the function dirReduc(arr). How does this work, why don't we get "RangeError: Maximum call stack size exceeded."? I tested by removing the ternary operator and just returning the arr, and it worked, which makes more sense to me. If it work, why did the authors of solutions of this kata use the ternary operator instead of just returning the arr?