Skip to content

Instantly share code, notes, and snippets.

@ethanstenis
Created July 13, 2017 18:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ethanstenis/6a222df6ecde73ac8bdd85840643a717 to your computer and use it in GitHub Desktop.
Save ethanstenis/6a222df6ecde73ac8bdd85840643a717 to your computer and use it in GitHub Desktop.
This is the solution for the Codewars Kata: Welcome!
function greet(language) {
var database = {
english: "Welcome",
czech: "Vitejte",
danish: "Velkomst",
dutch: "Welkom",
estonian: "Tere tulemast",
finnish: "Tervetuloa",
flemish: "Welgekomen",
french: "Bienvenue",
german: "Willkommen",
irish: "Failte",
italian: "Benvenuto",
latvian: "Gaidits",
lithuanian: "Laukiamas",
polish: "Witamy",
spanish: "Bienvenido",
swedish: "Valkommen",
welsh: "Croeso"
};
for (var key in database)
{
if (key == language)
{
return database[key];
}
}
return database["english"];
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment