I have a Javascript object:
{ "answers": "[0,0,0,0,1]" }
I want to convert the answer string to an array:
answer
array
var array = [0,0,0,0,1]
Use the Json.parse()function for that.
Json.parse()
const answers = "[0,0,0,0,1]" console.log(JSON.parse(answers))