title: Get key value based on value of another key in object
body: <p>I have a case I keep coming across where I need to get just an object key - not the entire object - based on another key value in the same object, all from an array of objects.</p>
  
  <p>So for example, if I have the following array of objects:</p>
  
  <pre><code>myArray = [
    {
      name: Person 1
      type: alpha
    },
    {
      name: Person 2
      type: beta
    },
    {
      name: Person 3
      type: gamma
    },
    {
      name: Person 4
      type: beta
    },
    {
      name: Person 5
      type: gamma
    },
  ];
  </code></pre>
  
  <p>So if I want to get just the name values for those objects with a type of 'beta', how would I do that? I prefer lodash, and I know how to use _.map or _.filter, e.g.</p>
  
  <pre><code>var newArray = _.map(myArray, function(item) {
    return item.type === 'beta';
  });
  </code></pre>
  
  <p>but those return the whole object. I suspect I can get what I want with chaining, but I'm not figuring out how I can do this.</p>
  
  <p>Thanks.</p>