Skip to content

Instantly share code, notes, and snippets.

@Kalimaha
Created April 11, 2016 09:36
Show Gist options
  • Select an option

  • Save Kalimaha/169e342e5f4966cae5c0c926e8fb2b87 to your computer and use it in GitHub Desktop.

Select an option

Save Kalimaha/169e342e5f4966cae5c0c926e8fb2b87 to your computer and use it in GitHub Desktop.
function parse() {
var data = {"data": [{"score": 2650, "user": {"name": "Adriano Sanna", "id": "10153481303254109"}}]};
var nomiAmici = [];
var scoreAmici = [];
for (var i = 0; i < data.data.length; i += 1) {
nomiAmici.push(data.data[i].score);
scoreAmici.push(data.data[i].user.name);
}
console.log(nomiAmici);
console.log(scoreAmici);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment