1. String type"[[1,2],[2,4],[3,6],[1,2]]", hope to get array type[ [1,2],[2,4],[3,6],[1,2]]
"[[1,2],[2,4],[3,6],[1,2]]"
[ [1,2],[2,4],[3,6],[1,2]]
走同样的路,发现不同的人生
var arr = JSON.parse("[[1,2],[2,4],[3,6],[1,2]]");
var str = "[[1,2],[2,4],[3,6],[1,2]]"; var newStr = JSON.parse(str); .log(newStr);
function g(str){ return JSON.parse(str); };
You can just search for JSON.parse. Baidu is better for this kind of problem
var arr = JSON.parse("[[1,2],[2,4],[3,6],[1,2]]");
Process ->
Packaging ->
You can just search for JSON.parse. Baidu is better for this kind of problem