How can I count how many times a function argument has been used in JS?
I need to construct a function, which takes a black-box one-argument function as an argument. And I need to know, how many times the black-box function uses its argument Example signature: function argCounter(fn) { return (arg) => { let argCalls = 0 ... fn(arg) return argCalls } } Example use: const fn1 = argCounter(obj =>