I have a string formatted as below:
{"title":"XYZ","id":"123"} {"title":"NPS","id":"124"}{"title":"LMW","id":"125"}
I am trying to convert this into an array by storing it in a variable and splitting it as such:
let prodInfo = "{"title":"XYZ","id":"123"} {"title":"NPS","id":"124"}{"title":"LMW","id":"125"}";
I then split this variable as in:
let infoArry = prodInfo.split("}");
console.log(infoArry);
The results I get after this is:

The issue is when I loop through this array to access titles separately, I get it as undefined.
Any recommendations would be appreciated
JSON.parse()[{"title":"XYZ","id":"123"},{"title":"NPS","id":"124"},{"title":"LMW","id":"125"}]then you can just use JSON.parse(str)