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: 
So with [`Array.prototype.map()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) you can create a new structure based on its function's return value.

> 
> The `map()` method creates a new array populated with the results of calling a provided function on every element in the calling array.
> 
> 
> 

Think about the following:

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

const result = array.map(e => {
  return {
    name: e.name,
    modeType: e.data.modType
  }
});

console.log(result);
```

Or the same with destructuring:

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

const result = array.map(({name, data: {modType}}) => {
  return {
    name,
    modType
  }
});

console.log(result);
```

I hope that helps!
You can try this simple js code

```js
arr = arr.map(item => {
  const ob  = {} // create temporary object
  ob.name = item.name; // asign props from array object
  ob.modType = item.data.modType; // asign props from array object
  return ob // just return create object
})

```