Question: I am trying to use `.map()` 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:

```
  return dbJobs.map(job =>
    job.data.modType
  ); 

```

But how would I use ES6 syntax to handle taking an array of objects where each object looks like this:

```
{
  id: 123,
  name: "name value",
  data: {
    modType: "report",
    category: "value"
  }
}

```

... and return an array of objects where each object has two properties from the original objects, like this:

```
{
  name: "name value",
  modType: "report"
}

```

Answer: 
You could use a [destructuring](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment) and map objects with [short hand properties](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Object_initializer).

```js
var dbJobs = [{ id: 123, name: "name value", data: { modType: "report", category: "value" } }],
    result = dbJobs.map(({ name, data: { modType } }) => ({ name, modType })); 

console.log(result);
```
I believe this will do what you need:

```js
let obj = [{
  id: 123,
  name: "name value",
  data: {
    modType: "report",
    category: "value"
  }
}];

let res = obj.map(item => {
  return {
  modType: item.data.modType,
  category: item.data.category
  }
});
console.log(res);
```