- comments are in pairs. The first of the pair talks about what
happened "caching" and the second pair talks about what was
alerted "the same". This is confusing.
- changed comment so both lines tell the reader what happened
and what result was returned.
There has to be a scary CPU-intensive task here, otherwise the example wouldn't make sense. Hence the suppression of "can";
I have also removed "actually" because in this context it would be interpreted as "to your surprise", which is not the case here
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();
}