Last active
May 9, 2016 18:36
-
-
Save iAmNathanJ/61da5f29b9f4edbd7eb884e5b5057158 to your computer and use it in GitHub Desktop.
How To "callback"
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
function doSomethingWithTextFile(filePath, doThing) { | |
var text = readFile(filePath); | |
doThing(text); | |
} | |
doSomethingWithTextFile(‘my-file.txt’, console.log); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment