title: Is there a canonical pattern for implementing self-memorizing function in JavaScript?
body: <p>I need to implement a simple cache in JavaScript for storing results of ajax requests. I know that one of the way is to implement self-memorizing function. But is there some general pattern for this in JavaScript, without using any frameworks?</p>