001function greetingTranslation(lang=''){
002 if(lang.toLowerCase() === 'greek'){
003 return function(name){
004 console.log('Geia sou '+name);
005 }
006 } else if(lang.toLowerCase() === 'spanish'){
007 return function(name){
008 console.log('Hola '+name);
009 }
010 } else {
011
012 return function(name){
013 console.log('Hello '+name);
014 }
015 }
016}
017window.onload = function(){
018 let englishHello = greetingTranslation();
019 let spanishHello = greetingTranslation('SPANISH');
020 let greekHello = greetingTranslation('Greek');
021
022
023 spanishHello('Toby');
024 greekHello('Toby');
025 englishHello('Toby');
026
027
028 greetingTranslation('english')('World');
029}