title: Keeping only certain properties in a JavaScript object
body: <p>I have an object.  I would like to modify the object (not clone it) by removing all properties except for certain specific properties. For instance, if I started with this object:</p>
  
  <pre><code>var myObj={
      p1:123,
      p2:321,
      p3:{p3_1:1231,p3_2:342},
      p4:'23423',
      //....
      p99:{p99_1:'sadf',p99_2:234},
      p100:3434
  }
  </code></pre>
  
  <p>and only want properties p1, p2, and p100, how can I obtain this object:</p>
  
  <pre><code>var myObj={
      p1:123,
      p2:321,
      p100:3434
  }
  </code></pre>
  
  <p>I understand how I could do this with brute force, but would like a more elegant solution.</p>