Skip to content

Instantly share code, notes, and snippets.

@EranSch
Forked from anonymous/gist:a5ee00d15085cdffd917
Last active August 29, 2015 14:24
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 EranSch/946fc45a993a0406c8b4 to your computer and use it in GitHub Desktop.
Save EranSch/946fc45a993a0406c8b4 to your computer and use it in GitHub Desktop.
// given:
var sayHello = (function (name) {
var text = 'Hello, ' + name;
return function () {
console.log(text);
};
})('REX');
sayHello(); // This prints 'REX' to the console
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment