Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save gisderdube/ffb841c3b1a4f68d74386e3c7d3d4533 to your computer and use it in GitHub Desktop.
Save gisderdube/ffb841c3b1a4f68d74386e3c7d3d4533 to your computer and use it in GitHub Desktop.
function logCountry({name, code, language, currency, population, 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