I am working with a sample array of objects as shown below:
let arr = [{id: 1,name: 'Test',segment: 'test',subCategory: [{id: 1,name:'Test1',segment:'test1'}]}]
My goal is to reformat this array into the following structure:
let newArr = [{link: 'test', name: 'Test',subCategory: [{link: 'test1',name: 'Test1'}]}]
Can anyone provide an easy way to achieve this in typescript?