I need to map one object array into this format:
"Brandenburg Gate, Berlin": {latitude: 52.516272, longitude: 13.377722},
"Dortmund U-Tower": {latitude: 51.515, longitude: 7.453619},
"London Eye": {latitude: 51.503333, longitude: -0.119722},
"Kremlin, Moscow": {latitude: 55.751667, longitude: 37.617778},
"Eiffel Tower, Paris": {latitude: 48.8583, longitude: 2.2945},
"Riksdag building, Stockholm": {latitude: 59.3275, longitude: 18.0675},
"Royal Palace, Oslo": {latitude: 59.916911, longitude: 10.727567}
}
where my source array looks like
{place: "Brandenburg Gate, Berlin", latitude: 52.5, longitude 13.3 }
I can't figure out how to make place be the key of the array.
_.map(a, function (m) {return m.place: {longitude: m.longitude}})
is obviously wrong.