1. String type"[[1,2],[2,4],[3,6],[1,2]]"
, hope to get array type[ [1,2],[2,4],[3,6],[1,2]]
漂亮男人2017-06-30 09:59:28
var str = "[[1,2],[2,4],[3,6],[1,2]]";
var newStr = JSON.parse(str);
.log(newStr);
function g(str){
return JSON.parse(str);
};
怪我咯2017-06-30 09:59:28
You can just search for JSON.parse. Baidu is better for this kind of problem