Wording was ungrammatical and hard to understand. I made my best guess as to what you want to say. However, it is not clear from the description or the examples whether the debounce wrapper should inhibit calls attempted ms milliseconds after the last call that wasn't ignored, or ms milliseconds after the last call that was attempted, even if it was ignored. I would think it would be the former, but the example could go either way. If the f(4) example used 1000 or 1001 ms and still runs, that would clear it up. If it has to be 1100 like it is, that would suggest that it's the second scenario above. In my propsed change I preserved the ambiguity.
Qualify that while cachingDecorator() will now work with any number of arguments, the hash() function given will not. Or, perhaps better, could just change the hash function to something like:
function hash(args) {
return [...args].join();
}
Says "is the same object as:", but what's below is an assignment (that includes an object). I didn't have any problem understanding it, didn't even notice it at first, but I thought it would be more accurate this way without sacrificing clarity.
1. Since is general statement, thought might be better to use general function name.
2. "Do the following steps" is a bit awkward, in that usually one doesn't "do" steps (but rather "takes", or "follows", or "executes" steps, perhaps). But it does convey the meaning, and perhaps it's a relatively new usage in business or tech that I'm not familiar with. For me, it comes off a bit awkward. Leaving out "steps" works grammatically and preserves the sense. Or could find another verb to replace "do" -- but nothing perfect came to mind. Not that bad the way it is, but since I was already changing the sentence...