Shoxrux,
next.onclick = e=>{
indexOfList++;
if(indexOfList >= data.length){
indexOfList = 0
}
title.textContent = data[indexOfList].name
animal.src = data[indexOfList].src
descript.textContent = data[indexOfList].description
}
prev.onclick= e =>{
indexOfList--;
if(indexOfList < 0 ) {
indexOfList = data.length - 1
};
title.textContent = data[indexOfList].name
animal.src = data[indexOfList].src
descript.textContent = data[indexOfList].description
}