I have a response which contains an array which is present inside string(""
). What I need I just the array. How do I get rid of the quotes?
I tried JSON.parse()
. It gave me error message
SyntaxError: Unexpected token ' in JSON at position 1
What I have is as follows:
email_id: "['abc@mail.com', 'cde@mail.com']"
What I need is as follows:
email_id: ['abc@mail.com', 'cde@mail.com']
This is a key which a part of a large response I am getting from backend in my angular 7 app.