I have a json which as follows.

```
const d = {
data:{name:"name1", type:"abc"},
parent:{
    data: {name:"parent1"},
    parent:{
      data: { name:"superparent1"},
      parent: null
     }  
  }
}

```

I want to get final output as "superparent1 / parent1 / name1" in an array. It should show the parent till the parent is null. How can I do that?