我想在javascript中将坐标存储到数组中,我是javascript的新手,不知道该怎么做。如有任何帮助,我们将不胜感激。 最佳答案 有很多方法可以存储x,y坐标:选项1(数组中每隔一个索引):functionstoreCoordinate(x,y,array){array.push(x);array.push(y);}varcoords=[];storeCoordinate(3,5,coords);storeCoordinate(19,1000,coords);storeCoordinate(-300,4578,coords)