digamos que tengo una matriz que se ve así:
var arr = [{ "id": 1, "content": "[{\"number\":1,\"name\":\"Image\",\"description\":\"\",\"fields\":\"[{\\\"number\\\":1,\\\"text\\\":\\\"Image Test\\\",\\\"description\\\":\\\"\\\",\\\"responseType\\\":\\\"Image\\\",\\\"options\\\":\\\"[]\\\"},{\\\"number\\\":2,\\\"text\\\":\\\"test2\\\",\\\"description\\\":\\\"\\\",\\\"responseType\\\":\\\"Text\\\",\\\"options\\\":\\\"[]\\\"}]\"}]" }];Estoy tratando de acceder al contenido que es una matriz anidada.
Estoy haciendo esto:
var myArray = JSON.parse(arr.content); console.log(myArray);Pero esto siempre devuelve este error:
SyntaxError: JSON Parse error: Unexpected identifier "undefined"¿Qué estoy haciendo mal aquí?
myArray = JSON.parse(arr[0].content);