Skip to content

Instantly share code, notes, and snippets.

@sebmck
Forked from domderen/correct.js
Created May 11, 2015 10:11
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 sebmck/726e30aff82b3305c9e3 to your computer and use it in GitHub Desktop.
Save sebmck/726e30aff82b3305c9e3 to your computer and use it in GitHub Desktop.
function getValues () {
return {
a: 1,
b: 2
};
}
let {a, b} = getValues();
console.log(a, b);
function getValues () {
return {
a: 1,
b: 2
};
}
let a, b;
({a, b} = getValues());
console.log(a, b);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment