cant get values from array using javascript
<p>Am trying to get the latitude and the longitude from a callback array. the array sometimes has one object inside and sometimes 2 objects.</p>

<blockquote>
  <p>Object { place={...}, reference={...}} OR [Object { place={...},  reference={...}}, Object { place={...},  reference={...}}]</p>
</blockquote>

<pre><code>    Placemaker.getPlaces(text,function(o){
    console.log(o);
    if (typeof o.match!=='undefined' || o.length==1){
     latitude=o.match.place.centroid.latitude, longitude=o.match.place.centroid.longitude; 
     console.log(latitude,longitude);}
     /*else if(o=='null'){
         latitude='', longitude=''; 
     }*/
     else if (typeof o.match[0]!=='undefined' || o.match.length==2){
        latitude=o.match[0].place.centroid.latitude, longitude=o.match[0].place.centroid.longitude; 
     console.log(latitude,longitude);
     }
</code></pre>

<p>Basically i can get the latitude and longitude from the array that has one object and not from when there are two set of objects inside .this is the error I get</p>

<pre><code>TypeError: o.match is undefined
[Break On This Error]   

else if (typeof o.match[0]!=='undefined' || o.match.length==2){
</code></pre>

<p>thank you all for your help !</p>
