// count total no. of groups created by me
function totalGroups(response) {
FB.api('/me/groups', {fields:'owner'}, function(g_response) {
for (i in g_response.data) {
FB.api('/me', function(m_response) {
var c = 0;
if (g_response.data[i].owner.name == m_response.name) {
c++;
}
});
}
console.log('Total:' +c);
});
}
hi, can i have another FB.api() calls inside FB.api() like i do on the above code because i can't get the value for if (g_response.data[i].owner.name == m_response.name)