Skip to content

Instantly share code, notes, and snippets.

@brunosabot
Created March 30, 2022 16:44
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 brunosabot/49aa78f8bc47f9fca3f568aa440b20ab to your computer and use it in GitHub Desktop.
Save brunosabot/49aa78f8bc47f9fca3f568aa440b20ab to your computer and use it in GitHub Desktop.
const frenchFlagColors = { blue: "#00F", white: "#FFF", red: "#F00" };
const belgianFlagColors = { black: "#000", yellow: "#FF0", red: "#F00" };
const { blue, white, red: frenchRed } = frenchFlagColors;
const { black, yellow, red: belgianRed } = belgianFlagColors;
console.log(blue); // #00F
console.log(white); // #FFF
console.log(frenchRed); // #F00
console.log(black); // #000
console.log(yellow); // #FF0
console.log(belgianRed); // #F00
console.log(red); // undefined
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment