function getAnyItem(arr, position) {
if (position > arr.length) {
return position = arr[0] ;
}
let index = arr[position];
return index;
}
I am really struggling on finding a way to go back round an array without using loops.Above is what I have written so far, all I get it undefined. Any help would be much appreciated as I am new to coding.
getItem(['a','b','c'], 10) should return 'b'