Created
June 24, 2018 17:57
-
-
Save sevperez/402952f6a3fa68d1cf1e89ca40bab280 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 applicator(fn, val) { | |
return function() { | |
fn(val); | |
}; | |
} | |
function speak(string) { | |
console.log(string); | |
} | |
var sayHello = applicator(speak, "Hello"); | |
sayHello(); // logs "Hello"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment