title: Empty a Javascript Object (Jquery Mobile)
body: <p>I have an app using jquery-mobile and jquery. 
  On the first page there is an object created which is then used for temporary storage:</p>
  
  <pre><code>var StorageObject = new object();
  </code></pre>
  
  <p>This is defined in the global space so it is persistent in the session.
  As links are clicked and actions taken the object is updated with values:</p>
  
  <pre><code>StorageObject.value = 'something';
  </code></pre>
  
  <p>My problem is where you need to empty the object (if someone clicks cancel or something) and start again requiring an empty storage object. Because jquery-mobile is essentially all on one page there is no reloading of the global space and therefore the storage object persists from last use.
  I do not believe there is anything I can call to empty the object without writing some recursive code to run through every value and empty it.</p>
  
  <p>Is there a way of emptying the object or should I be doing this another way?</p>
  
  <p>===========================================</p>
  
  <p>Edit:</p>
  
  <p>Having followed the advice of those below I still had the problem of an array within the storage object. 
  I have to change the initial definition so i defined the storage object from:</p>
  
  <pre><code>StorageObject.value  = 0;
  StorageObject.ArrayofValues = new Array();
  </code></pre>
  
  <p>to: </p>
  
  <pre><code>function MyStorageObject(){
    this.value = 0;
    this.ArrayofValues = new Array();
  };
  
  var StorageObject = new MyStorageObject();
  </code></pre>
  
  <p>from there on in I can, as others have suggested, just call:</p>
  
  <pre><code>StorageObject = new MyStorageObject();
  </code></pre>
  
  <p>to get a new copy of it :)</p>