I am facing an issue with converting a string to an array. The original string looks like this:
a= "['url1','url2','url3']"
When trying to convert it to an array, it should look like this:
arr = ["url1","url2","url3"]
However, using JSON.parse
does not seem to be working and is throwing the following error:
SyntaxError: Unexpected token ' in JSON at position 1
Your help on this matter would be greatly appreciated.