我有从后端获取的json格式字符串。我需要解析和过滤数组。但我收到json解析错误。
let backendData = '[{"Value":"{\"y1\":\"344,659\",\"y2\":\"10,145\",\"y3\":\"0\",\"y4\":\"838\"}","Name":"GlobalStatistics"},{"Value":"[{\"name\":\"HQ\",\"y\":62.0},{\"name\":\"CO\",\"y\":38.0}]","Name":"HQvsCO"},{"Value":"[{\"Location\":\"United States\",\"y\":81.0,\"ActualValue\":6855.0},{\"Location\":\"India\",\"y\":9.0,\"ActualValue\":752.0},{\"Location\":\"France\",\"y\":6.0,\"ActualValue\":525.0},{\"Location\":\"Kenya\",\"y\":2.0,\"ActualValue\":179.0},{\"Location\":\"Indonesia\",\"y\":1.0,\"ActualValue\":114.0}]","Name":"TopLocationsByUsers"}]';
backendData.replace(/\//g, "");
JSON.parse(backendData);
我需要将后端字符串转换为array.i出现解析错误
未捕获到的SyntaxError:JSON中位置13处的意外令牌y