Whenever I try to search for an answer to this question, I am unable to find any relevant results. So please excuse me if this has been asked before in a different way.
I want to preserve all quotation marks in my JSON when converting from a string.
In my user interface, there is a text field (string) where users will input some JSON that looks like this:
{ "example": "example" }
I want all the quotation marks to stay in my JSON object. But, when I use JSON.parse() on the string above, it strips away the quotes and gives me this:
{ example: "example" }
Is there a way to prevent the removal of the quotation marks?