Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@aherve
Created August 30, 2017 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save aherve/741753e1f25e4c87450e6aebe590134b to your computer and use it in GitHub Desktop.
Save aherve/741753e1f25e4c87450e6aebe590134b to your computer and use it in GitHub Desktop.
// get uniq from array
const numbers = [1, 2, 1, 1, 2, 1, 3, 4, 1 ]
const uniq = [...new Set(numbers)] // => [ 1, 2, 3, 4 ]
const uniq2 = Array.from(new Set(numbers)) // => [ 1, 2, 3, 4 ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment