won't loop array javascript
<p>Why cant i access my array?</p>

<pre><code>function map(array){
    for(i=0; i &lt;=array.length; i++){
        var location=array[i].location;
        console.log("loc"+location);
        var user = array[i].from_user;
        console.log("user"+user);
        var date = array[i].created_at;
        var profile_img = array[i].profile_img;
        var text = array[i].text;
        var contentString = text;
        //geocode(user,date, profile_img, text, contentString,location);
    }
}
</code></pre>

<p>It gives me undefined for every element.I want to access it and pass the variables to the geocode function.
data structure:</p>

<pre><code>array=[{user: a,user_id: b,date: c,profile_img: d,text: e,contentString: f,url:
      g,location:o},{user: a,user_id: b,date: c,profile_img: d,text: e,contentString: 
      f,url:g,location:o},{user: a,user_id: b,date: c,profile_img: d,text: 
      e,contentString: f,url: g,location:s}];
</code></pre>

<p>dont worry about the values..!</p>

<p>I forgot to mention when i first made the post(question). the location of the array is inserted in the previous function whereas the array didn't include the attribute location from previous functions</p>
