Created
June 19, 2017 11:30
-
-
Save ksakae1216/b38b14aa27ad774425ccc2242576aeb5 to your computer and use it in GitHub Desktop.
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 = [5,2,3,1,3,2,2]; | |
// 重複を削除し、並び替える | |
var b = a.filter(function (x, i, self) { | |
return self.indexOf(x) === i; | |
}).sort(); | |
console.log(b); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment