I have a list object

```js
{
  value: 5,
  rest: {
    value: 10,
    rest: {
      value: 15,
      rest: null
    }
  }
}

```

that should be converted into array. I was trying to iterate through the list to take the values and push them into array.

```
function listToArr(obj){
let arr = []
    for (let val in object){
        arr.push(Object.values(val))
    }
    return arr
}

```

But I am getting `[ [ 'v', 'a', 'l', 'u', 'e' ], [ 'r', 'e', 's', 't' ] ]`