In my project I have a use case like the below:
I have a response Array like below,
(4) [{…}, {…}, {…}, {…}]
0:{header: 0, name: "Name", field: "Id"}
1:{header: 3, name: "LastName", field: "Agreement__c"}
2:{header: 3, name: "LastName", field: "Amount__c"}
3:{header: 3, name: "LastName", field: "BIC__c"}
length:4
from the above I convert the above array to String by using,
JSON.stringify(responseArray) and store it in a string field.
After that I want to do some manipulation dynamically to that value of that field. So when I get the value back from the field it came as like below,
[{"header":0,"name":"Name","field":"Id"},
{"header":3,"name":"LastName","field":"Agreement__c"},
{"header":3,"name":"LastName","field":"Amount__c"},
{"header":3,"name":"LastName","field":"BIC__c"}]
Anyone please help me to convert the above string response to an Array in Javascript like as follows,
index 0 -> {"header":0,"name":"Name","field":"Id"}
index 1 -> {"header":3,"name":"LastName","field":"Agreement"}
I have tried with the split function but couldn't able to achieve the exact need.
"{"header":0,"name":"Name","field":"Id"},That is invalid syntax.