Question: I need a nested array, but I've got a array with nested objects.

What i have:

```
[
    { id: 1, title: 'title', value: 'test data'}
    { id: 2, title: 'title', value: 'test data'}
]

```

But i need:

```
[
    [ 1, 'title', 'test data']
    [ 2, 'title', 'test data']
]

```

Answer: 
using `forEach` loop:

```js
var obj = [
    { id: 1, title: 'title', value: 'test data'},
    { id: 2, title: 'title', value: 'test data'}
];

var arr = [];

obj.forEach(function(o, k) {
 arr.push([o.id, o.title, o.value]);
});

console.log(arr);
```
You just need to use [**Array.proptotype.map()**](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map?v=example) method along with [**Object.values()**](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/values) to loop your array and return the wanted result:

```
var results = data.map(function(item) {
  var elem = [];
  elem.push(Object.values(item));
  return elem;
});

```

**Demo:**

```js
var data = [{
    id: 1,
    title: 'title',
    value: 'test data'
  },
  {
    id: 2,
    title: 'title',
    value: 'test data'
  }
];

var results = data.map(function(item) {
  var elem = [];
  elem.push(Object.values(item));
  return elem;
});

console.log(JSON.stringify(results));
```