There are two different sets of numbers
Numbers1=[ 0, 1, 2, 0, 2 ]
;
Numbers2=[ 0, 0, 1, 2, 2 ]
;
The goal is to determine the index of each element in Numbers2 from Numbers1 and create a new array like [0,3,1,2,4]
;
If you would like to see the code I wrote, check it out here. However, please note that it currently does not account for duplicate values in the arrays.
var index = [];
for (i = 0; i <= Numbers2.length - 1; i++) {
index.push(Numbers1.indexOf(Numbers2[i]));
}