Skip to content

Instantly share code, notes, and snippets.

@kiprasmel
Last active July 5, 2021 13:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kiprasmel/4a0926ce3be1bdb7af7757c8e90614fd to your computer and use it in GitHub Desktop.
Save kiprasmel/4a0926ce3be1bdb7af7757c8e90614fd to your computer and use it in GitHub Desktop.
const doFoo = ({ a = 10, b, c } = {}) => {
console.log(a, b, c);
};
doFoo(); // a 10 b undefined c undefined
doFoo({ b: 20 }); // a 10 b 20 c undefined
// /\ a still with default value!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment