Skip to content

Instantly share code, notes, and snippets.

@codeaholicguy
Created December 30, 2015 09:38
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
function sayHello(){
var message = 'Hello'; // define a local variable.
return function(){ // return a function from sayHello.
console.log(message); // wanna know if 'message' still in scope?
}
}
var helloSayer = sayHello();
helloSayer(); // call the inner function returned from sayHello.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment