let arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
find(2);
find(15);
function find(num) {
if(num > arr.length) {
num = num - arr.length;
}
for (let i = 0; i < arr.length; i++) {
if(num === arr[i]) {
console.log(arr[i]);
}
}
}