Created
July 31, 2014 22:50
-
-
Save macikokoro/e56545ef125d61e3c92a to your computer and use it in GitHub Desktop.
Function expressions
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
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