title: Creating a backup of 'this'
body: <p>In javascript, I have an object (think of it as a shape), that can be put in edit mode and edited, or a not editable mode.  When editable mode, I want to have a cancel button that cancels all edits and returns the shape back to its original form.  I was hoping to use something like the following, but assigning things to 'this' doesn't work.  What would the best way to do this be?  I would prefer not to use external objects to store backups, because there could be many shapes and sorting out which backup corresponds to what adds code that is not as nicely packaged.</p>
  
  <pre><code>Shape.prototype.edit = function() {
      this.backup = this;
      ...
  }
  Shape.prototype.cancelEdit = function() {
      this = this.backup;
      ...
  }
  </code></pre>