How do I show a of list elements of an array?

Viewed 38

I have a large array of 465 items, with each item having five elements. E.g.

const fixture = {id: '955dc591ce70', title: 'Liverpool vs Arsenal', date: '2022-03-18', start: '2022-03-18T19:35:00', end: '2022-03-18T21:05:00', competition: 'Premier League'}

I want to ouput an array of just the competitions for each game. I have tried console.log(this.state.fixtures.competition) but no success. How can i acheiev this?

1 Answers

Try this outputting to console

this.state.fixtures.forEach(fixture => console.log(fixture.competition));
Related