Skip to content

Instantly share code, notes, and snippets.

@hatched
Created February 29, 2016 21:55
Show Gist options
  • Save hatched/ff0100393cd8ec3766e2 to your computer and use it in GitHub Desktop.
Save hatched/ff0100393cd8ec3766e2 to your computer and use it in GitHub Desktop.
Named params
function foo({bar=0} = {}) {
console.log(bar)
}
foo({bar: 7}) // 7
foo() // 0
foo(true) // 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment