I have array of objects in string format I want to convert it into normal array of objects. I have used JSON.parse() to convert it but when I am trying to get the value like: this.contact_data[0].data.value it shows undefined.
It's my array of objects:
contact_data.data='[{'name':"Number",'value':"22222222"},{'name':"gmail",'value':"xyz@gamil.com"}]'
The key in the array of objects after stringify should be in double quotes like " but this is in single quotes ' that's why it will not parse
'[{"name":"Number","value":"22222222"},{"name":"gmail","value":"xyz@gamil.com"}]'
this is correct stringify array which will parse
'[{'name':"Number",'value':"22222222"},{'name':"gmail",'value':"xyz@gamil.com"}]'
and this is you array