title: Using ES6 Syntax to Map an Array of Values to Array of Truncated Objects
body: <p>I am trying to use <code>.map()</code> and ES6 syntax to return a truncated version of each object in my array. I can do this to get one value from the original object passed on:</p>
  
  <pre><code>  return dbJobs.map(job =&gt;
      job.data.modType
    ); 
  </code></pre>
  
  <p>But how would I use ES6 syntax to handle taking an array of objects where each object looks like this:</p>
  
  <pre><code>{
    id: 123,
    name: "name value",
    data: {
      modType: "report",
      category: "value"
    }
  }
  </code></pre>
  
  <p>... and return an array of objects where each object has two properties from the original objects, like this:</p>
  
  <pre><code>{
    name: "name value",
    modType: "report"
  }
  </code></pre>