I have json format string that has keys without inverted commas. So I am not able to parse this string to json using var jsonV = JSON.parse(fileStr)
. How can I put the keys of dictionary into inverted commas and then parse the string to json? Below is the example string I want to parse into json.
{
title: 'Service Requests',
navTitle: 'Service Requests',
headers: {
id: 'ID',
priority: 'Priority',
status: 'Status',
},
}
I am getting this as string only. I want to parse this into JSON.
Edit: I tried this and this links. But none of these answered my question. These doesn't take the condition that if we have only string having json elements without inverted commas like in below example. (I cant even iterated through this string object as)