I have a list object { 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