Skip to content

Instantly share code, notes, and snippets.

@salmanx
Last active April 10, 2021 14:33
Show Gist options
  • Save salmanx/b1f2a180fa379655ebcdd0366d4e27ee to your computer and use it in GitHub Desktop.
Save salmanx/b1f2a180fa379655ebcdd0366d4e27ee to your computer and use it in GitHub Desktop.
Remove duplicated items from js array
const arr = [1, 1, 12, 4, 4, true, false, true, null];
const filteredArr = [...new Set(arrr)]
// result: [1, 12, 4, true, false, null]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment