Skip to content

Instantly share code, notes, and snippets.

@jergason
Created May 5, 2012 00:48
Show Gist options
  • Select an option

  • Save jergason/2598829 to your computer and use it in GitHub Desktop.

Select an option

Save jergason/2598829 to your computer and use it in GitHub Desktop.
Named function expressions in JavaScript
(function () {
"use strict";
function doSomething(cb) {
console.log('do something!');
cb();
}
doSomething(function hurp() { console.log('hurp!'); });
// prints out:
// do something!
// hurp!
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment