回答編集履歴
1
findIndex
answer
CHANGED
@@ -4,4 +4,15 @@
|
|
4
4
|
- [Array.prototype.find() - JavaScript | MDN](https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/Array/find)
|
5
5
|
- [Array.prototype.filter() - JavaScript | MDN](https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/Array/filter)
|
6
6
|
|
7
|
+
**(2018/4/28 13:14追記)**
|
8
|
+
index値が欲しいのなら、kei344 さんの回答通り、findIndexを利用して下さい。
|
9
|
+
|
10
|
+
- [Array.prototype.findIndex() - JavaScript | MDN](https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex)
|
11
|
+
|
12
|
+
複数のindex値が欲しいのなら、自作を。
|
13
|
+
|
14
|
+
- [JavaScript - 二次元配列で、特定Keyに対するValueが重複しているものを、1つ残して重複を無くすのではなく全部削除したい(39930)|teratail](https://teratail.com/questions/39930)
|
15
|
+
|
16
|
+
`Array.prototype.reduce` を使うのも有りですね。
|
17
|
+
|
7
18
|
Re: MarkAndrews さん
|