Skip to content

Instantly share code, notes, and snippets.

@hatched
Created February 29, 2016 21:55
Show Gist options
  • Select an option

  • Save hatched/ff0100393cd8ec3766e2 to your computer and use it in GitHub Desktop.

Select an option

Save hatched/ff0100393cd8ec3766e2 to your computer and use it in GitHub Desktop.

Revisions

  1. hatched created this gist Feb 29, 2016.
    7 changes: 7 additions & 0 deletions named-params.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    function foo({bar=0} = {}) {
    console.log(bar)
    }

    foo({bar: 7}) // 7
    foo() // 0
    foo(true) // 0