I am using one 3rd party plugin which uses stringify and gives me something like:
["ProjectB","ProjectA","Paris"]
It was an array but it used stringify and serialized into this format.How do I get back my array from this? Now I could very well use split and then remove 1st and last character from every string and get it but I don’t want to do that manually. Is that any built in utility that can do that for me?
Assuming you have like
var str = '["ProjectB","ProjectA","Paris"]';Try using,
As @AlexMA pointed out:
JSON.parseis not supported in old browsers so you are better off using jQuery version like below,