Ad
  • Default User Avatar

    I saw a post on reddit with this same exact problem as a challenge for an interview. I have been defeated by this one and surrendered to see the solution. This is a great kata but I feel like this should be in the 3 or 4 kyu range.

  • Default User Avatar
  • Custom User Avatar

    The ultimate hardcoded solution I've seen at 3kyu.

    Mad Props.

  • Custom User Avatar

    You misspelled handler in your description on one of the lines.

    .emit() should use its own invocation context as handers' invocation context
    

    should be

    .emit() should use its own invocation context as handlers' invocation context
    
  • Custom User Avatar

    Brilliant solution, I love it!

  • Default User Avatar

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

  • Custom User Avatar

    It would be nice if we could see what the "rest" function is in the description. I'm not sure what to do with the pipeline function. Does it invoke the functions on the object intially, then keep returning the value from the returned functions? not really sure what to do.

    *update: managed to solve it, nice kata but I think it needs better examples with multiple functions.

  • Custom User Avatar

    I revised the testing methods to Test.assertEquals. If you're still having trouble finding a solution please let me know. I'll be checking this kata everyday. I don't want to spoil the solution. I will say that of all the solutions I've seen, none of them involve the methods you guys have just mentioned.

  • Default User Avatar

    Hey wthit56, sorry I've taken so long to respond, I've had a busy month and totally forgot about this kata. I changed the tests from Test.expects to Test.assertEquals.

    Hopefully it will make it easier to revise your solution. The solution is quite simple, I'm sure you will get it. I'd rather not say much about it until you try it out using the new test methods. If you still have trouble I will give a better example.

  • Custom User Avatar

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

  • Custom User Avatar

    Yeah I'm having this same error, I wonder if it has to do with my solution.

  • Custom User Avatar

    I like it, great kata.

  • Custom User Avatar

    In my opinion, best practice would be to assign 'this' to a variable.

    var self = this;
    fn.apply(self);
    
  • Custom User Avatar

    Thanks, yeah I am new to making katas. I wasn't sure how the testing library works.

  • Custom User Avatar

    I like this, I completely forgot about the indexOf method. Good job!

  • Loading more items...