Нормальное
Но можно было и так
let nextSlide = function(){
if (index == slides.length - 1){
index = 0;
activeSlide(index);
activedots(index);
}
else{
index++;
activeSlide(index);
activedots(index);
}
clearInterval(interval);
}
next.addEventListener("click", nextSlide);
let prevSlide = function(){
if (index == 0){
index = slides.length -1;
activeSlide(index);
activedots(index);
}
else{
index--;
activeSlide(index);
activedots(index);
}
clearInterval(interval);
}
prev.addEventListener("click", prevSlide);