0

I have this array of objects:

[{"score":131,"skin":"player_main","created_at":"2016-12-13 19:40:44","name":"Bajabongo95"},{"score":10,"skin":"player_main","created_at":"2016-12-13 19:40:32","name":"Bajabongo95"}]

How I supposted to itterate through this?

I tried with:

result.forEach(function(element, i) {
    console.log(element.score);
});

and this:

for (var key in result) {
    console.log(key, result[key]);
}

None of this works. It gives me indexes or every letter (and letter as key), or an error:

forEach is not a function

How I can itterate this objects and get access to specified data?

Michał Lipa
  • 968
  • 2
  • 12
  • 22

0 Answers0