you will require 2 loops, 1 will go through each element of Array3 and Second loop will be used to find the index value will be compared with Array2 to find index of Array 1 and then that index value will be saved in Array4 from Array1
for (var i = 0; i < Array3.length; i++)
{
var index = Array3[i];
var position=-1;
for(var j=0; j < Array2.length;j++)
{
if(index==Array2[j])
{
position = j;
break;
}
}
Array4[i] = Array1[j];
}
solved How to display the array?