Created
April 24, 2017 03:44
-
-
Save fxcosta/c29a67c213a8f437bdf09ad80bf31019 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
portugueseHello = function () { | |
return "Olá, "; | |
} | |
englishHello = function () { | |
return "Hello, "; | |
} | |
francaisHello = function () { | |
return "Bonjour, "; | |
} | |
function helloWorld(languageFunction, name) { | |
// return `${languageFunction()} ${name}`; utilizando Template Literals do ES6+ | |
return languageFunction() + name; | |
} | |
helloWorld(portugueseHello, "Felix"); // output: Olá, Felix | |
helloWorld(englishHello, "Felix"); // output: Hello, Felix |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment