Sometime we want to show Json results on Browser Console. We can Use Javascript Plain class JSON
:
Convert String to Json type
We have this palin text:1
var text = '{"firstName":"John", "lastName":"Doe"}'
We can Convert it to Json type Like this:1
JSON.parse(text)
Convert Json to String
1 | JSON.stringify(jsonStr) |