Skip to content

Instantly share code, notes, and snippets.

@macikokoro
Created July 31, 2014 22:50
Show Gist options
  • Save macikokoro/e56545ef125d61e3c92a to your computer and use it in GitHub Desktop.
Save macikokoro/e56545ef125d61e3c92a to your computer and use it in GitHub Desktop.
Function expressions
var greeting;
newCustomer = true;//change to false or true for diff result.
if(newCustomer){
greeting = function() {
alert("Thanks for visiting our site!\n" + "Discover our content!");
};
} else {
greeting = function() {
alert("Welcome back!\n" + "We have new content for you!");
};
}
terminal(greeting);
function terminal(message) {
message();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment