var stops = [
{
"Geometry": {
"Latitude":52.1615470947258,
"Longitude":20.80514430999756
}
},
//next element of the same sort
]
我想使用javascript将元素推送到此数组中。我该怎么做?
答案 0 :(得分:1)
您应该使用.push
:
stops.push(elements);
答案 1 :(得分:0)
这个对你的情况没有帮助吗?
var stops = [{"Geometry":"Latitude":52.1615470947258,"Longitude":20.80514430999756}},next element of the same sort}]
var newStops = {"Geometry2":{"Latitude":52.1615470947258,"Longitude":20.80514430999756}}
stops.push(newStops)