Skip to content

Instantly share code, notes, and snippets.

@xkrsz
Last active January 28, 2018 15:38
Show Gist options
  • Save xkrsz/961a90816a4bb6d9b7079c91ad3599ab to your computer and use it in GitHub Desktop.
Save xkrsz/961a90816a4bb6d9b7079c91ad3599ab to your computer and use it in GitHub Desktop.
const greet = (name = ‘Mark’, surname = ‘Zuckerberg’, sex = ‘male’) => {
const title = sex === ‘male’ ? ‘Mr.’ : ‘Ms.’
  return `Greetings, ${title} ${name} ${surname}`
}
greet() // ‘Greetings, Mr. Mark Zuckerberg’
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment