Skip to content

Instantly share code, notes, and snippets.

@buymed-hoangpham
Last active September 25, 2022 08:16
Show Gist options
  • Save buymed-hoangpham/5ca2c70c14a6fab9248abcdec9aa51ae to your computer and use it in GitHub Desktop.
Save buymed-hoangpham/5ca2c70c14a6fab9248abcdec9aa51ae to your computer and use it in GitHub Desktop.
// 5
const getLocation = (city, country = 'Italy', continent = 'Europe') =>
console.log(continent, country, city);
getLocation('Milan');
// Europe Italy Milan
getLocation('Paris', 'France');
// Europe France Paris
//6
const calculatePrice = (total, tax = 0.1, tip = 0.05) =>
total + total * tax + total * tip;
//8
const person = {
first: 'Alberto',
last: 'Montalesi',
};
const { first, last } = person;
console.log(first, last);
const person = {
...person,
links:{
social: {
facebook: "https://www.facebook.com/alberto.montalesi",
},
website: "http://albertomontalesi.github.io/"
}
}
const { facebook } = person.links.social;
console.log(facebook);
// 12
const name = 'Alberto';
const surname = 'Montalesi';
const age = 25;
const nationality = 'Italian';
const person = {
name,
surname,
age,
nationality,
};
console.log(person);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment