Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement