Reputation: 15
This is what appears when I do
console.log(projects)
However, whenever I try to print anything beyond that, I receive errors or it simply does not print anything.
The things I have tried:
console.log(projects[0]);
console.log(projects.title);
I have also tried using the for each element loop to no luck.
How would I grab the title of each element within this?
Upvotes: 1
Views: 13468
Reputation: 2698
Try this :
console.log(projects[0].title);
First you need to access first array element and after the property
and for the foreach :
projects.forEach(projet=>console.log(projet.title));
Upvotes: 5