Convert string to array or object

前端 未结 1 448
栀梦
栀梦 2021-01-29 02:01

is there possible to convert this string to array or object? It is not a valid stringify JSON data, not sure how to tackle this.

\"{\"subject\":\"Test Comment\"}         


        
相关标签:
1条回答
  • 2021-01-29 02:30

    Like this:

    JSON.parse('[' + '{"subject":"Test Comment"},{"message":"Test Message."}' + ']')
    
    0 讨论(0)
提交回复
热议问题