I have an array of object , [{name:'abc'},{name:'def'},{name:'ghi'}]
. When I loop map()
on this array I am getting array like [0:{name:'abc'},1:{name:'def'},2:{name:'ghi'}]
. I want to change index number to string values like ['string1':{name:'abc'},'string2':{name:'def'},'string3:{name:'ghi'}]
. Actually it will change ( 0, 1,2 ) indexes to string . I tried but didn't find any solution . Could someone please help me how to resolve this issue . ?
any simple example will be appreciated
Thanks