title: _.pick method to match the sub property in an objects array
body: <p>I am using _.pick method in the following manner</p>
  
  <p>suppose I have an array of strings which are nothing but property names I want to get from each object in array of objects</p>
  
  <pre><code>var wantedPropArray=["prop1","prop2","prop3.name"];
  </code></pre>
  
  <p>Below is my objects array</p>
  
  <pre><code>var objectArray = [
          {"prop1":"prop1Data1","prop2":"prop2Data1","prop3":{"name":"Tom","age":"24","class":"graduate"},"prop4":"prop4Data1","prop5":"prop5Data1"},
          {"prop1":"prop1Data2","prop2":"prop2Data2","prop3":{"name":"Cat","age":"24","class":"graduate"},"prop4":"prop4Data2","prop5":"prop5Data2"}
          {"prop1":"prop1Data3","prop2":"prop2Data3","prop3":{"name":"Tom","age":"24","class":"graduate"},"prop4":"prop4Data3","prop5":"prop5Data3"}
          {"prop1":"prop1Data4","prop2":"prop2Data4","prop3":{"name":"Tom","age":"24","class":"graduate"},"prop4":"prop4Data4","prop5":"prop5Data4"}
      ]
  for( var item in objectArray ){          
      var objectArrayOnlySelectedProperties = _.pick(objectArray[item] , wantedPropArray);
  }
  </code></pre>
  
  <p>suppose for first iteration lets see objectArrayOnlySelectedProperties  data,
  I am getting</p>
  
  <pre><code>objectArrayOnlySelectedProperties = {"prop1":"prop1Data1","prop2":"prop2Data1"};
  </code></pre>
  
  <p>I am expecting it to give me the result something like this</p>
  
  <pre><code>objectArrayOnlySelectedProperties = {"prop1":"prop1Data1","prop2":"prop2Data1","prop3.name":"Tom"};
  </code></pre>
  
  <p>what i mean to say is _.pick method is not able to look into prop3 and get me prop3.name.
  Can anyone suggest how to use underscores' pick method to match the sub properties of each object in an array.</p>
  
  <p>Thanks in advance</p>