Use JSON.parse()
and replace the starting and ending "
with backticks
JSON.parse(`[
{
"userId": 1,
"id": 1,
"title": "delectus aut autem",
"completed": false
},
{
"userId": 1,
"id": 5,
"title": "laboriosam mollitia et enim quasi adipisci quia provident illum",
"completed": false
}
]`)
solved convert a string JSON into an Array [duplicate]