Ad
  • Custom User Avatar

    the comparison to "(" in the else statement only checks if stack.pop failed due to not having any more entries.

  • Custom User Avatar

    This would break if a function with rest params is yacked, right?

    Say you yack function add(x, y, z, ...more), which adds x, y, z, and everything in more. If you yack(add)(1, 2, 3, 4, 5), you'd get 15, not 6.

    (I'm jealous of such a concise answer tbh :)

  • Custom User Avatar

    Using arrow functions (which would maintain the same context in a class object as normal functions, and follows the condition .emit() should use its own invocation context as handers' invocation context) breaks some test cases under should subscribe handlers and invoke them with correct arguments and context since you can't redefine the context of an arrow function via call, apply, bind, or otherwise.

  • Custom User Avatar

    Shouldn't you not be accessing private variables in prototype methods? I'm curious as to how you formatted your first solution since locally scoped variables aren't accessible in methods defined in the prototype.