dimanche 22 avril 2018

Javascript loop ignore array index

I am attempting to loop over product data where each node of data is in its own index of the array. How can I return all "product-name" or "product-url" values regardless of their index?

My code looks like this

var products = res.data.CO;

products.forEach((product, index) => {
    console.log(product);
});

I am able to return each entry but not able to use dot or bracket notation to only bring back one value from each entry. Any help is much appreciated.

Here is my data https://i.stack.imgur.com/Zn5oL.png




Aucun commentaire:

Enregistrer un commentaire