首先我是java腳本新手。使用Javascript添加數組元素
我想將變量插入到包含經度和緯度的動態數組中。希望有幫助...
var locations = [
[ test, test1],
[ -33.923036, 151.259052],
[ -34.028249, 151.157507],
[ -33.80010128657071, 151.28747820854187],
[-33.950198, 151.259302 ]
];
var test = -33.923036; var test1 = 151.259052;
在此先感謝。
問題是什麼?什麼是'console.log(locations)'? – Rayon
locations.push(test); –
我試着用數組拼接,但我沒有去知道如何將數組添加到另一個數組? –