Skip to content

Instantly share code, notes, and snippets.

@gisderdube
Created April 4, 2019 08:50
Show Gist options
  • Save gisderdube/ca8f916e8d12b8a1e2bbe251cd6fcd01 to your computer and use it in GitHub Desktop.
Save gisderdube/ca8f916e8d12b8a1e2bbe251cd6fcd01 to your computer and use it in GitHub Desktop.
function logCountry({
name = 'United States',
code,
language = 'English',
currency = 'USD',
population = '327 Million',
continent,
}) {
let msg = `The official language of ${name} `
if(code) msg += `(${code}) `
msg += `is ${language}. ${population} inhabitants pay in ${currency}.`
if(contintent) msg += ` The country is located in ${continent}`
}
logCountry({
name: 'Germany',
code: 'DE',
language 'german',
currency: 'Euro',
population: '82 Million',
})
logCountry({
name: 'China',
language 'mandarin',
currency: 'Renminbi',
population: '1.4 Billion',
continent: 'Asia',
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment