I've been trying to figure this out for a while and I just can't. I have an object, which has an array in it, which has objects in it. I'm trying to figure out how to use a for loop to search through the array's objects. Heres my attempt:
var obj = {
array: [
{"meme" : "123", "mememe" : "456"},
{"meme" : "234", "mememe" : "567"}
]
}
console.log(obj.array)
for(var i in obj) {
console.log(i);
};
This code logs the array like this:
[ { meme: '123', mememe: '456' },
{ meme: '234', mememe: '567' } ]
Then it just logs:
0
1
What I want it to log is something like
{ meme: '123', mememe: '456' }
{ meme: '234', mememe: '567' }
So I can then do something with this code.