Javascript add array elements -
first of new java script.
i insert variables type ofarray dynamically containing latitude , longitude. hoping 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.
try -
you have use push method insert object array.
var test = -33.923036; var test1 = 151.259052; var locations = [ [ -33.923036, 151.259052], [ -34.028249, 151.157507], [ -33.80010128657071, 151.28747820854187], [-33.950198, 151.259302 ] ]; locations.push([test, test1]) console.log(locations)
Comments
Post a Comment