Skip to content

Instantly share code, notes, and snippets.

@brmendez
Created August 10, 2018 18:29
Show Gist options
  • Save brmendez/cba7c8707e54ceea4a26e9ce71880515 to your computer and use it in GitHub Desktop.
Save brmendez/cba7c8707e54ceea4a26e9ce71880515 to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/ligamufive
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
var a = [1,2,2,2,3,3,100,100,100];
var unique = a.filter((x,i,a) =>
a.indexOf(x) == i
);
console.log(unique);
</script>
<script id="jsbin-source-javascript" type="text/javascript">var a = [1,2,2,2,3,3,100,100,100];
var unique = a.filter((x,i,a) =>
a.indexOf(x) == i
);
console.log(unique);</script></body>
</html>
var a = [1,2,2,2,3,3,100,100,100];
var unique = a.filter((x,i,a) =>
a.indexOf(x) == i
);
console.log(unique);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment