0
function tracks(id) {

    $.get("https://api.spotify.com/v1/albums/" + id + "/tracks", function(data, status) {
        data.items.map(function(item) {
            console.log(item.name)
        });
    });
}

}

var json = [{
    track: [tracks('5KM8hybz2fW6ThBDWETbX1')]
}]

I'm getting my value in the console.log, but I'm not able to push it to object; I tried return item.name it's null.

rrk
  • 15,677
  • 4
  • 29
  • 45
Jennifer
  • 905
  • 9
  • 20

0 Answers0