Last active
August 1, 2018 16:46
-
-
Save sevperez/4787eab2a694bb50721896c846206915 to your computer and use it in GitHub Desktop.
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
function makeEventDescriber(event, date) { | |
return function() { | |
console.log(date + ": " + event); | |
}; | |
} | |
var coffeeWithAda = makeEventDescriber("Coffee with Ada.", "8/1/2018"); | |
var partyAtCharles = makeEventDescriber("Party at Charles' house.", "8/4/2018"); | |
coffeeWithAda(); // Logs: "8/1/2018: Coffee with Ada." | |
partyAtCharles(); // Logs: "8/4/2018: Party at Charles' house." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment