Skip to content

Instantly share code, notes, and snippets.

@nivrith
Created November 27, 2020 09:47
Show Gist options
  • Select an option

  • Save nivrith/2db29fc2fd8d878ec40794f42e5532be to your computer and use it in GitHub Desktop.

Select an option

Save nivrith/2db29fc2fd8d878ec40794f42e5532be to your computer and use it in GitHub Desktop.
Use Set to filter Uni values in array
const array = [1, 2, 2, 3,3, 4, 5, 5, 3, 6, 9]
const uniqueArray = [...new Set(array)];
console.log(uniqueArray); //[1, 4, 6, 9]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment