I am trying to compare the two arrays, more specifically to do something with values from the first one whose positions matches the numbers from second one.
var valuesList = ['value1', 'value2', 'value3', 'value4', 'value5'],
positionNumberList = [0, 2, 4];
from above arrays value1 should be eq to 0 from second one, value3 = 2 .etc
I started with the code below but can not get the position of the values from the first array.
for(j=0; j < valuesList.length; j++){
for(k=0; k < positionNumberList.length; k++){
//find matching values from first array
}
}