直接上例子:
var str ='[1,2,3,4,5]'; var arr =[]; str=str.slice(1,str.length-1); arr=str.split(','); console.log(typeof arr); console.log(arr[0]);//1 console.log(arr.toString()) //1,2,3,4,5