0

TypeScriptArray

Greetings. I have a problem with the array. I don't know how to display multiple dimensional arrays. This is the picture of my code on the left side and on right, I have JSON that I must display in Insomnia for the test. You can see

"lineups": {
                   "home_team": {
                       "starting_lineups": [
                           {
                               "player": "Asghar A. (C)",
                               "player_country": "Afghanistan"
                           },
....

I must display all the players and countries. All lines work well but for player and player_country, when I display, program print "undefined".

Thanks!

1 Answers1

0

starting_lineups is array:

If you want to to use player_country from first array item:

hometeam.lineups.home_team.starting_lineups[0].player_country
Darius
  • 1,060
  • 2
  • 6
  • 17