0

I want to iterate over an array that has three objects nested within, within the objects i would just like to return the value of each object not the key, So far:

let foo = [{name: "nick"}, {name: "poop"}, {name: "bar"}]

var vals = Object.keys(foo).map(function (key) {
    console.log(foo[key]);
});

i am doing a problem from codewars and so far im only able to print each object. i forgot to fav the challenge so sorry i cant link the question. thanks in advance

0 Answers0