Skip to content

Instantly share code, notes, and snippets.

@strich
Created September 3, 2014 07:16
Show Gist options
  • Save strich/40c7b144ab1cfe85fdd5 to your computer and use it in GitHub Desktop.
Save strich/40c7b144ab1cfe85fdd5 to your computer and use it in GitHub Desktop.
var someArray[];
int arrayPos = 0;
CallFunction(funcArray, arrayPos, null, null);
CallFunction(var funcArray[], int arrayPos, var result, var parentObject) {
var newResult;
var newParentObject;
if(result == null) {
newResult = window[funcArray[arrayPos]];
newParentObject = newResult();
} else {
newParentObject = window[funcArray[arrayPos]];
newResult = result();
}
arrayPos++;
CallFunction(funcArray, arrayPos, newResult, newParentObject);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment