Question: I build this array:

```
const array = [
  {
    title: 'something',
    list: ['a', 'b', 'c', 'd']
  },
  {
    title: 'dog',
    list: ['aa']
  },
  {
    title: 'cat',
    list: ['aaa', 'b', 'cccc']
  },
  {
    title: 'apple',
    list: [],
  }
]

```

I would like an array containing all the values in the other arrays, so:

```
const res = ['a', 'b', 'c', 'd', 'aa', 'aaa', 'b', 'cccc']

```

I can I do that? I can use `concat` but how?

Answer: 
Use `concat` and `reduce` together

```js
var a=[
  {
    title: 'something',
    list: ['a', 'b', 'c', 'd']
  },
  {
    title: 'dog',
    list: ['aa']
  },
  {
    title: 'cat',
    list: ['aaa', 'b', 'cccc']
  },
  {
    title: 'apple',
    list: [],
  }
];
console.log(a.reduce((acc,e)=>acc.concat(e.list),[]))
```
using `reduce` and the `...`(spread operator) it is very simple to do.

```js
const array = [{
    title: 'something',
    list: ['a', 'b', 'c', 'd']
  },
  {
    title: 'dog',
    list: ['aa']
  },
  {
    title: 'cat',
    list: ['aaa', 'b', 'cccc']
  },
  {
    title: 'apple',
    list: [],
  }
]

const result = array.reduce((accum, item) => {
  return [...accum, ...item.list]
}, [])

console.log(result);
```