I want to produce something like this
album = {[
name:'',
image:'',
tracks:[]
],[
name:'',
image:'',
tracks:[]
]}
But now I'm stuck at appending the value into the right json object.
var albums = {};
$.get("https://api.spotify.com/v1/artists/1rQX6kg84TqcwGtZHYIdn4/albums", function(data, status) {
tempArr = [];
$.each(data.items, function(i, obj) {
tempArr.push(obj.images[0].url);
albums['image'] = tempArr;
});
console.log(albums)
});
You can see the albumn data here http://jsfiddle.net/u5me8csx/1 Any help?