Created
June 24, 2016 23:01
-
-
Save akirattii/d30934e62064b5826005ac61529f2e0b to your computer and use it in GitHub Desktop.
配列操作のsnippets
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 arr = ["", "", "hoge", "baa", "hogege", "", "foo", "", ""]; | |
var newArr = arr.filter((x, i, self) => self.indexOf(x) === i); | |
// newArr -> ["", "hoge", "baa", "hogege", "foo"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment