Created
August 10, 2018 18:29
-
-
Save brmendez/cba7c8707e54ceea4a26e9ce71880515 to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/ligamufive
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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