If I have an array of strings:
array1 = ['mango', 'orange', 'apple','strawberry'];
and one array of indexes:
array2 = [1,3];
How can I create a new array with the strings in array1, based on the indexes in array2?
The new array would in this case look like this:
array3 = [orange, strawberry]
map:const array3 = array2.map((index) => array1[index]).