Last active
January 11, 2017 17:26
-
-
Save woliveiras/a22ecdb945c3e1d489c6053718829dcd to your computer and use it in GitHub Desktop.
This file contains hidden or 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
function printAfterTimeout(string, timeout, done){ | |
setTimeout(function(){ | |
done(string); | |
}, timeout); | |
} | |
printAfterTimeout('Hello ', 2e3, function(result){ | |
console.log(result); | |
// nested callback | |
printAfterTimeout(result + 'Reader', 2e3, function(result){ | |
console.log(result); | |
}); | |
}); | |
// Hello | |
// Hello Reader |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment