我有这个功能
var globalvar = new Array();
function coor(coor1){
for(i=0;i<=coor1.length;i++){
exy = coor1[i].split(".");
ex = exy[0].split("-");
ey = exy[1].split("-");
for(x=parseInt(ex[0]);x<=parseInt(ex[1]);x++){
for(y=parseInt(ey[0]);y<=parseInt(ey[1]);y++){
globalvar.push(ex[x]+"."+ey[y]);
}
}
}
}
// execute function
coor(["5-7.8-9","1-2.3-4"]);
我期待的是……
变量将在globalvar
数组中包含此值
globalvar = ["5.8","5.9","6.8","6.9","7.8","7.9","1.3","1.4","2.3","2.4"];
我希望任何人都可以帮我解决这个问题... Y_Y 因为当我使用我当前的代码时,它会返回empty