My goal is to create an array that look something like this
var locations = [
[
"New Mermaid",
36.9079,
-76.199
],
[
"1950 Fish Dish",
36.87224,
-76.29518
]
];
I've tried
var data = $locations;
var locations = [];
for (i = 0; i < data.length; i++) {
locations[i] =
data[i]['name']+','+
data[i]['lat']+','+
data[i]['lng'];
}
console.log(locations);
I've got
["Apple HQ,33.0241101,39.5865834", "Google MA,43.9315743,20.2366877"]
However that is not the exact format.
I want
var locations = [
[
"New Mermaid",
36.9079,
-76.199
],
[
"1950 Fish Dish",
36.87224,
-76.29518
]
];
How do I update my JS to get something like that ?
{company: 'Apple HQ', lat: '33.024', long: '39.586'}.