"[{"poll_watcher_id":5,"precinct_id":"","candidate_id":1,"count":"123"},
{"poll_watcher_id":5,"precinct_id":"","candidate_id":9},
{"poll_watcher_id":5,"precinct_id":"","candidate_id":6},
{"poll_watcher_id":5,"precinct_id":"","candidate_id":3},
{"poll_watcher_id":5,"precinct_id":"","candidate_id":7},
{"poll_watcher_id":5,"precinct_id":"","candidate_id":4}]"
此输出只是一个String,我想要将其转换为对象数组,以供我在此输出中使用数据
最佳答案
通过在字符串上使用 JSON.parse
。