function getDistance(lat1, lat2, lon1, lon2){
var R = 6371; //KM
var d = Math.acos(Math.sin(lat1) * Math.sin(lat2) +
Math.cos(lat1) * Math.cos(lat2) * Math.cos(lon2 - lon1)) * R
return d
};
var items = [[1,2],[3,4],[5,6]];
alert(items[0][0]); // 1
document.write(getDistance(items[0][0],items[1][1],items[1][2],items[2][2]));
document.write(getDistance(45,35,41,35));
为什么我不能在函数中调用我的数组元素(项)getDistance
?