title: javascript: truncate object properties in an array
body: <p>I have an array of objects, say the object looks like following:</p>
  
  <pre><code>var row = {
      data: 'test',
     text: 'test'
  };
  </code></pre>
  
  <p>I want to loop through the array and just get the object with text property.
  What is the best way to do it?
  So, I want to loop and the object should look like: <code>row = {text: 'test'}</code></p>
  
  <p>I tried something like below without luck:</p>
  
  <pre><code>arr.forEach(function (item){ //arr is the array of object
       return {text: item.text};
  });
  </code></pre>