[Solved] How to filter data from one array based on another array


valueArray = ["a","b","c","d","e"]; // arr1
indexArray = [1,3]; // arr2

valueArray = indexArray.map(index => valueArray[index]);

console.log(valueArray);

solved How to filter data from one array based on another array