Skip to content

Instantly share code, notes, and snippets.

@TheShubhamVsnv
Created May 12, 2024 17:01
Show Gist options
  • Save TheShubhamVsnv/ecc76bef0355a3a0522deb4195dbf478 to your computer and use it in GitHub Desktop.
Save TheShubhamVsnv/ecc76bef0355a3a0522deb4195dbf478 to your computer and use it in GitHub Desktop.
let uniqueColors = new Set(["red", "blue", "green"]);
uniqueColors.forEach(color => console.log(color)); // Display each color
let allColors = [...uniqueColors.keys()]; // Get all unique colors
let allColorValues = [...uniqueColors.values()]; // Get all unique color values
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment