Skip to content

Instantly share code, notes, and snippets.

@iceener
Created April 18, 2020 13:34
Show Gist options
  • Save iceener/86b68092ea8d2ac00b5ebb46c6d44f40 to your computer and use it in GitHub Desktop.
Save iceener/86b68092ea8d2ac00b5ebb46c6d44f40 to your computer and use it in GitHub Desktop.
// Destructuring
const args = [1, 2, 3, 4];
const [a, b, c, d] = args;
console.log(a, b, c, d);
const coords = { x: 1, y: 10 };
const { x: horizontal, y } = coords;
horizontal; /*?*/
y; /*?*/
const response = { data: { value: 5 } };
function render({ data: { value } }) {
console.log(value);
}
render(response);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment