Created
May 5, 2012 00:48
-
-
Save jergason/2598829 to your computer and use it in GitHub Desktop.
Named function expressions in JavaScript
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 () { | |
| "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