Ad
  • Custom User Avatar

    That makes sense. Thank you for the kata and clarification!

  • Custom User Avatar

    Could someone please explain to me why we have to return true if a function was called with a specific argument instead of set of arguments?
    I just don't see how that can be a desirable outcome.

    Say, we call adderSpy(1, 2, 3)
    and adderSpy.wasCalledWith(2) must return true.

    Wouldn't it be much more meaningful only for adderSpy.wasCalledWith(1, 2, 3) to return true in this case?

  • Custom User Avatar

    Amazing explanation for probably the most effective solution!

  • Custom User Avatar

    Sorting given array seems like a wasted effort in this case, especially when you consider that it's not even properly sorted. That would still get the job done, but it's an expensive solution.