-1

Here is what I have now:

 console.log(JSON.stringify(errorParam))
 {"data":{"message":"{\"ErrorLine\":113,\"ErrorMessage\":\"Authentication Failed\",\"ErrorNumber\":50004,\"ErrorProcedure\":\"start_test\"}"},"status":400,"statusText":"Bad Request"}

I know about JSON.stringify but how can I convert this back into an object from a string?

Alan2
  • 21,590
  • 73
  • 223
  • 402

1 Answers1

2

I know about JSON.stringify but how can I convert this back into an object from a string?

Use JSON.parse

console.log(JSON.parse('{"data":{"message":"{\"ErrorLine\":113,\"ErrorMessage\":\"Authentication Failed\",\"ErrorNumber\":50004,\"ErrorProcedure\":\"start_test\"}"},"status":400,"statusText":"Bad Request"}'));
gurvinder372
  • 64,240
  • 8
  • 67
  • 88