1

I have the following JSON object

var artist_list=
{
  "albums": [
    {
      "name": "Bleach",
      "artist": "Nirvana",
      "unitsSold": 1700000
    },
    {
      "name": "Nevermind",
      "artist": "Nirvana",
      "unitsSold": 30000000
    },
    {
      "name": "In Utero",
      "artist": "Nirvana",
      "unitsSold": 15000000
    },
    {
      "name": "Ten",
      "artist": "Pearl Jam",
      "unitsSold": 10000000
    },
    {
      "name": "Vs",
      "artist": "Pearl Jam",
      "unitsSold": 6100000
    },
    {
      "name": "Vitalogy",
      "artist": "Pearl Jam",
      "unitsSold": 4770000
    }
  ]
};

I would like to extract the artist's name from this JSON object into a separate list. I am very new to JavaScript and JSON objects. Any suggestions would be helpful.

Expected output.

Output: Nirvana, Pearl Jam

gis
  • 31
  • 6

0 Answers0