Created
September 19, 2012 23:18
-
-
Save nvcexploder/3752978 to your computer and use it in GitHub Desktop.
Recursive Call
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
internals.searchChildren = function ( id, toSearch, callback ) { | |
for( child in toSearch ) { | |
console.log('FOR LOOP'); | |
if( id == toSearch[child].id ) { | |
//return the child | |
callback(null, toSearch[child].children); | |
break; | |
} else { | |
if( toSearch[child].children ) { | |
internals.searchChildren( id, toSearch[child], retrieveCallback ); | |
} | |
} | |
} | |
console.log('************'); | |
console.log('stopping now'); | |
console.log('************'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment