How to get index of all occurrence of the same value in an Array?

Viewed 2127

I have two arrays like arr1, arr2. Each array having different kind of values. In array one i have repeated some values in multiple times. How can i get same value index and value? Also, how to get array two values from array one same value index?

var arr1 = [100, 200, 100, 300, 600, 200];
var arr2 = [1, 2, 3, 4, 5, 6];

For example, If my custom value is 200. arr1 result will be [1, 5]. How to get arr2 value like [2, 6].

5 Answers
Related