Created
August 1, 2018 16:06
-
-
Save sevperez/3cd49dce75740e4ba2dec29b037b69d8 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 schedulerMaker(name) { | |
return function(event) { | |
return function() { | |
console.log(event + " with " + name + "."); | |
}; | |
}; | |
} | |
var adaScheduler = schedulerMaker("Ada"); | |
var coffeeWithAda = adaScheduler("Coffee"); | |
coffeeWithAda(); // Logs: "Coffee with Ada." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment