Skip to content

Instantly share code, notes, and snippets.

@rayinla
Last active December 29, 2017 13:53
Show Gist options
  • Save rayinla/835b389fd0b19de9c70f22db2f4e897a to your computer and use it in GitHub Desktop.
Save rayinla/835b389fd0b19de9c70f22db2f4e897a to your computer and use it in GitHub Desktop.
function init(args){
var firstName = args.firstName;
var lastName = args.lastName;
function gerunding(action){
return firstName + " " + lastName + " " + "is" + " " + action;
}
return gerunding;
}
var data = {firstName: "George", lastName: "Rooney" };
var zombieOne = init(data); //when we initialize the outer function, it returns undefined. The outer function is dead, but...
/*
20 lines of code later...
*/
zombieOne("walking"); // George Rooney is walking
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment