Skip to content

Instantly share code, notes, and snippets.

@RedWolves
Created July 24, 2014 16:17
Show Gist options
  • Save RedWolves/4f5355f2492d4690f298 to your computer and use it in GitHub Desktop.
Save RedWolves/4f5355f2492d4690f298 to your computer and use it in GitHub Desktop.
Function Abstractions
var work = function () {
console.log("working hard!");
};
var doWork = function(f) {
console.log("starting");
try {
f();
} catch (ex) {
console.log(ex);
}
console.log("end");
};
doWork(work); // we only pass the reference to work we don't invoke it with ().
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment