I am facing issue while converting the value from below string. Tried to parse JSON but didn't work.
const val1 = "{a: '123'}";
console.log(typeof(val1)); // string
const a = JSON.parse(val1); // Gives Error: Unexpected token a in JSON at position 1
const b = JSON.parse(JSON.stringify(val1));
console.log(b); // {a: '123'}
console.log(b.a); // ---> undefined
console.log(typeof(b)); // string -> How?
Again if I do, JSON.parse(b) -> Gives error: Unexpected token a in JSON at position.
Can someone suggest what I am doing wrong
