Given an object with an ID and array of dependancies that reference other IDs within the main object, create a function that accepts the main object and the desired ID such that the output would be all the dependancies, then the given ID.
EX:
all = [
{id:1, dep:[4,5]},
{id:4, dep:[6]},
{id:5, dep:[]},
{id:6, dep:[]}
]
func(all, 1) => 6,4,5,1