I am trying to access the text property of each object stored in an array. The array is a value of another property, results, inside an object.
I retrieve the object from a server using jQuery, like this.
$.ajax({
url: "https://api.parse.com/1/classes/chats",
cache: false,
type: 'get',
async: false,
success: function(data){
console.log(data);
}
});
The log statement at the end is to see what I am receiving. Naturally this is where I need to be doing something, but I can't seem to crack the code. So, I have an object with the result property and Array value. The array is an array of objects, each with their own properties. I'm just a bit confused on how to get what I need. Perhaps a gentle nudge in the right direction?
Object {results: Array[10]} //object returned
results: Array[10] //value is an array of objects
0: Object // object '0' expanded...
createdAt: "2013-10-15T19:13:43.576Z"<br><br>
objectId: "uzGerloXA7"
text: "RoboChat: I'm sorry Dave, I can't allow you to do that." // I need this!
updatedAt: "2013-10-15T19:13:43.576Z"
username: "RoboChat"
1:Object // and I need it for each of these objects.
2:Object
3:Object
etc...
9:Object //this is the last object.