Map current array with values by index from another array in JavaScript

Let’s imagine I have to arrays:

const array1 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
const array2 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];

array2.map((elem, index) => {
  // Looking here to return the value from array1 by index
});

In array2 I am looking to return value from array1, by the index position, but just in range 1 -10. The idea is that it should go in a kind of circle where start value is 1 and end is 10.

More examples of how it should work:

  • Index 1 from array2 -> return 1 from array1
  • Index 10 from array2 -> return 10 from array1
  • Index 12 from array2 -> return 2 from array1
  • Index 20 from array2 -> return 10 from array1
  • Index 999 from array2 -> return 9 from array1
  • Index 1225 from array2 -> return 5 from array1