Last active
October 12, 2018 14:33
-
-
Save krzysztofczernek/a6ad486d5075c609dbc74dd3a4ef422d to your computer and use it in GitHub Desktop.
This file contains 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 makeGreeter (greeting) { | |
return function greet (name) { | |
return `${greeting}, ${name}!` | |
} | |
} | |
// or, using the ES6 syntax: | |
const makeGreeter = greeting => name => `${greeting}, ${name}!` | |
const greet = makeGreeter('Hello') | |
console.log(greet('Krzysztof')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment