Skip to content

Instantly share code, notes, and snippets.

@MartinsAlexandre
Last active March 26, 2018 12:23
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 MartinsAlexandre/0fcdf80400ce6a867c193dae411d982a to your computer and use it in GitHub Desktop.
Save MartinsAlexandre/0fcdf80400ce6a867c193dae411d982a to your computer and use it in GitHub Desktop.
es6-3
const address = {
city: "Lyon",
state: "FR",
zip: 69001
};
const sportList = ['Football', 'BasketBall']
const ortherSportList = ['Boxe', 'Judo']
function display(address, ...sports) {
let mySports = [];
mySports.push(...sports);
let city = address.city === undefined ? "Paris" : address.city;
console.log("je viens de " + city + " mes sports favoris sont : " + mySports);
}
display(address, sportList, ortherSportList);
display();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment