There is an array of valid:
var points = [[52.0625,142.962494],[52.0625,143.129166],[52.054165,142.995834],[52.054165,143.079163],[52.054165,143.145828], ...] I run through the loop and take only the values and put them in the object:
$.each(points, function(k, v){ var myArray = []; var myObject = { "lat": v[0], "lon": v[1] } }); There is also an empty array
var myArray = []; in this scenario:
myArray.push(myObject); console.log(myArray) Output:
[Object] [Object] [Object] [Object] [Object] [Object] [Object] ...
And I need to put all the objects in the empty array myArray = []; so that consol.log would output like this:
[Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, …] I can not understand where my mistake? Tell me please. Thanks in advance!!!