how to convert array of arrays to array of objects
<p>I am trying to create a json file to test out some react-native <a href="https://github.com/lelandrichardson/react-native-maps/blob/master/example/examples/Overlays.js" rel="nofollow">map polygon functionality</a>. I have geoJson available from a project using leaflet maps. I need to format the lat/lng points. I have drilled down from the top level-geometry-coordinates. but I am stuck on what to do next. Since i only need the end result for testing any library can be used in the plunker to get the desired result. </p>

<p>here is where i am at. </p>

<pre><code>[
[
    [
        -106.75845,
        34.659846
    ],
    [
        -106.81188,
        34.649485
    ],
    [
        -106.80648,
        34.646378
    ],
    [
        -106.75845,
        34.659846
    ]
],
[
    [
        -106.70432,
        34.650473
    ],
    [
        -106.79663,
        34.720663
    ],
    [
        -106.7278,
        34.637498
    ],
    [
        -106.70432,
        34.650473
    ]
]
</code></pre>

<p>]</p>

<p>this is the what i need the end result to look like. <a href="https://plnkr.co/edit/Okn4PpBSAaM43NZjuCO6?p=catalogue" rel="nofollow">plunker</a></p>

<pre><code>  // desired result
  var result = [[{
                    latitude: 0,
                    longitude: 0
                }, {
                    latitude: 0,
                    longitude: 0
                }, {
                    latitude: 0,
                    longitude: 0
                }], [{
                    latitude: 0,
                    longitude: 0
                }, {
                    latitude: 0,
                    longitude: 0
                }, {
                    latitude: 0,
                    longitude: 0
                }]];
</code></pre>