How to convert this to JS object:
{"info":["Image has been added"],"success":["No success Sorry!"]}
JSON.parse throws an error and says " isn't valid JSON. Am new to JS and can't figure out how to deal with this.
I am using connect-flash from express to transfer flash messages to the client side. For doing so, I am using the following code:
if Object.keys(locals.flashes).length !== 0
script.
flashArr="#{JSON.stringify(locals.flashes)}"
On the client side, the representation of the Object isn't valid JSON. How can I handle this.