Created
February 28, 2018 13:08
-
-
Save AlexLo33/58e7b8e4991b7c2fddae80cfdf273961 to your computer and use it in GitHub Desktop.
This file contains 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
(() => { | |
'use strict'; | |
const address = { | |
city: "Lyon", | |
state: "FR", | |
zip: 69001 | |
}; | |
const listeSports = ['Football', 'BasketBall'] | |
const autreListeSports = ['Boxe', 'Judo'] | |
function afficher({ | |
city: cityName | |
}, sports = []) { | |
if (sports.length > 0) { | |
return `La ville de ${cityName} est ouverte aux sports suivants : ${[...sports]}`; | |
} else { | |
return `Aucun sport n'est disponible dans la ville de ${cityName}`; | |
} | |
} | |
console.log(afficher(address, [...listeSports, ...autreListeSports])); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment