I pass a string through "objName".
I want this to to be stored in the line: facebookData.objName
For example:
if I invoke the function like, fetchData(0, response, "friendsCount"), the object should be like: facebookData.friendsCount = dLen;
Note: facebookData is a global object.
function fetchData(dLen, response, objName){
if(response.paging){
if(!response.paging.next){
facebookData.objName = dLen; //Problem is here
return dLen;
}
else{
-------------------
fetchData(dLen, response, objName);
}
}
facebookData[objName] = dLen;