get values from different arrays javascript
<p>I am using yahoo's placemaker to extract location names from text. From this I get a callback function which gives me 2 different types of arrays.</p>

<p>this is the code am using but I CANT ANY of the values I want.</p>

<pre><code>  Placemaker.getPlaces(text,function(o){
  if (typeof o.match!=='undefined' &amp;&amp; o.match.length==1){
   latitude=o.match.place.centroid.latitude, longitude=o.match.place.centroid.longitude; 
   console.log(latitude,longitude);}

  if(typeof o.match !=='undefined'&amp;&amp; o.match.length==2){
    latitude=o[match].place.centroid.latitude,
    longitude=o[match].place.centroid.longitude;
   console.log(latitude,longitude);
      }
</code></pre>

<p>The first array looks like this</p>

<pre><code>({
    match: {
        place: {
            woeId: "29007292",
            type: "Town",
            name: "Jubila, West Bengal, IN",
            centroid: {
                latitude: "23.1626",
                longitude: "87.7889"
            }
        },
        reference: [{
            woeIds: "29007292",
            placeReferenceId: "2",
            placeIds: "1",
            start: "14",
            end: "20",
            isPlaintextMarker: "1",
            text: "jubila",
            type: "plaintext",
            xpath: null
        }, {
            woeIds: "29007292",
            placeReferenceId: "3",
            placeIds: "1",
            start: "82",
            end: "88",
            isPlaintextMarker: "1",
            text: "jubila",
            type: "plaintext",
            xpath: null
        }]
    }
})
</code></pre>

<p>and the other one like this</p>

<pre><code>({
    match: [{
        place: {
            woeId: "23424950",
            type: "Country",
            name: "Spain",
            centroid: {
                latitude: "39.8949",
                longitude: "-2.98831"
            }
        },
        reference: {
            woeIds: "23424950",
            placeReferenceId: "1",
            placeIds: "1",
            start: "64",
            end: "70",
            isPlaintextMarker: "1",
            text: "Espa\xF1a",
            type: "plaintext",
            xpath: null
        }
    }, {
        place: {
            woeId: "24865675",
            type: "Continent",
            name: "Europe",
            centroid: {
                latitude: "52.9762",
                longitude: "7.85784"
            }
        },
        reference: {
            woeIds: "24865675",
            placeReferenceId: "2",
            placeIds: "2",
            start: "93",
            end: "99",
            isPlaintextMarker: "1",
            text: "Europa",
            type: "plaintext",
            xpath: null
        }
    }]
})
</code></pre>
