数组转字符串
2020-11-13 本文已影响0人
zZ_d205
//数组转字符串
arrToStr( objarr ){
var arrLen = objarr.length;
var row = "[";
for (var i = 0 ;i < arrLen ; i++){
row += "[";
for(var j = 0; j < objarr[i].length; j++){
row += objarr[i][j];
if(j < objarr[i].length-1){
row +=",";
}
}
row += "]";
if(i<arrLen-1){
row+=",";
}
}
row+="]";
return row;
},
转换效果:
[[116.29413671875,39.98160461425781],[116.29413671875,39.98160461425781],[116.43283911132812,39.87448791503906]]