Skip to content

Instantly share code, notes, and snippets.

@saturngod
Created August 21, 2011 03:36
Show Gist options
  • Save saturngod/1160076 to your computer and use it in GitHub Desktop.
Save saturngod/1160076 to your computer and use it in GitHub Desktop.
testing node call back
function callback_test(callback) {
for(var i=0;i<=10;i++){
callback(i);
}
}
callback_test(function(result) {
console.log(result);
callback_test(function(result2){
console.log(result2);
});
});
function callback_test(callback) {
for(i=0;i<=10;i++){
callback(i);
}
}
callback_test(function(result) {
console.log(result);
callback_test(function(result2){
console.log(result2);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment