Skip to content

Instantly share code, notes, and snippets.

@iAmNathanJ
Last active May 9, 2016 18:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iAmNathanJ/61da5f29b9f4edbd7eb884e5b5057158 to your computer and use it in GitHub Desktop.
Save iAmNathanJ/61da5f29b9f4edbd7eb884e5b5057158 to your computer and use it in GitHub Desktop.
How To "callback"
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