Skip to content

Instantly share code, notes, and snippets.

@robozavri
Created July 6, 2018 13:48
Show Gist options
  • Select an option

  • Save robozavri/4262c5a5a284ccf812422a6dfda3d2f9 to your computer and use it in GitHub Desktop.

Select an option

Save robozavri/4262c5a5a284ccf812422a6dfda3d2f9 to your computer and use it in GitHub Desktop.
js get unique values
var a = ["niko", "1", "niko", "3", "3", "1"];
var unique = a.filter(function(item, i, ar){ return ar.indexOf(item) === i; });
console.log(unique);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment