let slideIndex = 1;

const plusSlides = (n)=> {
  showSlides(slideIndex += n);
}

const currentSlide = (n)=> {
  showSlides(slideIndex = n);
}

const showSlides = (n)=> {
  let i;
  const slides = document.getElementsByClassName("mySlides");
  if (n > slides.length) {slideIndex = 1}    
  if (n < 1) {slideIndex = slides.length}
  for (i = 0; i < slides.length; i++) {
	slides[i].style.display = "none";  
  }
  slides[slideIndex-1].style.display = "flex";
}

showSlides(slideIndex);