第一种方法:
var string = "[13,3],[19,8]";
var items = string.replace('],[',']|[').split('|').map(
function(s) { return s.replace(/(\[\[| \[|\]\])/g, ''); }
);
var item= items.map(
function(s) { return JSON.parse(s) }
)
item
第二种:
第一种方法:
var string = "[13,3],[19,8]";
var items = string.replace('],[',']|[').split('|').map(
function(s) { return s.replace(/(\[\[| \[|\]\])/g, ''); }
);
var item= items.map(
function(s) { return JSON.parse(s) }
)
item
第二种: