I'm trying to display a specific property of multiple objects from the response of an axios call (using .innerHTML) but I can only get it to display one result of the array.
function getMusic(searchText){
if (artistButton.checked) {
axios.get('https://cors-anywhere.herokuapp.com/https://api.deezer.com/search/?q=artist:"'+searchText+'"')
.then(function(response){
console.log(response);
var artist = response.data.data;
for (var i = 0; i < artist.length; i++){
var artistResult = artist[i].artist.name;
console.log(artistResult);
}
document.getElementById("music").innerHTML = artistResult;
});
//tried using document.getElementById("music").innerHTML = artistResult.join(" "); but it gives me a TypeError