First of all I am new to JavaScript.
I would like to insert variables into this type of array dynamically that containing latitude and longitude. Hoping for helps...
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;
Thanks in advance.
console.log(locations)?locations.push([test, test1]). Or with.splice()(since you tried to use that, though.push()is a much better option):locations.splice(someIndex, 0, [test, test1]).