title: Is There A Way To Clear an Object In Javascript?
body: <p>Is there a way to clear an object in Javascript? Specifically if an object has several member variables is there a simple way to reset each value?</p>
  
  <pre><code>function exampleObject() {
      this.valueA = "A"; 
      this.valueB = "B"; 
      this.myArray = [1,2,3];
  }
  </code></pre>
  
  <p>So basically for an instance of the above reset the three members to empty strings and an empty array? I could easily prototype a member function for the object to do this and call it:</p>
  
  <pre><code>function exampleObject() {
      this.valueA = "A"; 
      this.valueB = "B"; 
      this.myArray = [1,2,3];
      exampleObject.prototype.resetAll = function() {
          this.valueA = ""; 
          this.valueB = ""; 
          this.myArray = [];
      }
  }
  </code></pre>
  
  <p>However I want to do this for objects from a third-party library so adding a member function isn't realistic. </p>