I have this function, i need to store some values in an array, i need t create an array variable and store them here.
I have this function :
function loadFriends()
{
//get array of friends
FB.api('/me/friends?fields=name,first_name,gender', function(response) {
console.log(response);
var divContainer=$('.facebook-friends');
var testdiv = document.getElementById("test");
for(var i=0; i<response.data.length; i++){
if(response.data[i].gender == 'male'){
testdiv.innerHTML += response.data[i].id + '<br />';
}
}
I need to store all values of response.data[i].id in an array, as an array.. i need something like var array = [1,2,3,4] where 1,2,3,4 are the response.data[i].id ...