This question already has an answer here:
- Parse JSON in JavaScript? [duplicate] 16 answers
I have a string like :
$scope.text = '"{\"firstName\":\"John\",\"age\":454 }"';
and I want to convert to js object:
$scope.tmp = {"firstName":"John","age":454 };
Note:
JSON.parse()
doesn't work!!It's my sample in codepen