Skip to content

Instantly share code, notes, and snippets.

@vsnikkil
Last active September 14, 2018 11:08
Show Gist options
  • Save vsnikkil/d729dd824f1de1d05e4cdcf67202ee57 to your computer and use it in GitHub Desktop.
Save vsnikkil/d729dd824f1de1d05e4cdcf67202ee57 to your computer and use it in GitHub Desktop.
// does not work on edge
((a, {b = 0, c = 3}) => { return a === 1 && b === 2 && c === 3; })(1, { b: 2 });
// works, surprisingly
((a, {b = 0, c = 3} = {}) => { return a === 1 && b === 2 && c === 3; })(1, { b: 2 });
// works
(({b = 0, c = 3}) => { return b === 2 && c === 3; })({ b: 2 });
// works
((a, {b = 0, c = 3} = undefined) => { return a === 1 && b === 2 && c === 3; })(1, { b: 2 });
// also works
(({b = 0, c = 3}, a) => { return a === 1 && b === 2 && c === 3; })({ b: 2 }, 1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment