Skip to content

Instantly share code, notes, and snippets.

@fxcosta
Created April 24, 2017 03:16
Show Gist options
  • Select an option

  • Save fxcosta/acb64747d7d36f47de64c9359a5de163 to your computer and use it in GitHub Desktop.

Select an option

Save fxcosta/acb64747d7d36f47de64c9359a5de163 to your computer and use it in GitHub Desktop.
portugueseHello = function () {
return "Olá, ";
}
englishHello = function () {
return "Hello, ";
}
francaisHello = function () {
return "Bonjour, ";
}
function helloWorld(languageFunction, name) {
console.log(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