You need Login/Signup to run/submit the code.
Implement a function that accepts a callback and restricts its invocation to at most N times | Lodash Polyfills | Frontend Problem Solving
In this question, you need to create a function that accepts a
callback restricts its invocation to the provided
n times. It is similar to the
_.before method provided by the
Calls to the function after the limit should return the value of the last invocation. The
callback is invoked with the
this binding and arguments of the created function.
callback (Function): The function to restrict.
n (number): The number of calls at which
callbackis no longer invoked.
(Function): Returns the new restricted function.
Start the timer, complete your solution, test your solution against the test cases provided by the platform, and submit it. Ideally, you should finish this question within 30 mins.