I’m watching TraverstyMedia on YouTube (great channel for learnging btw), and his code (seemingly, to me) randomly declares “i” in the middle of his js code. Current already = 0, so is he saying that i = current, as well?
Also, I’ve seen i used before in similar slideshow js. Is there something special about it, or is it just the default more or less because i is the first letter of image? These are the first two bits of code.
Thanks for any help offered!
let sliderImages = document.querySelectorAll(".slide"),
arrowLeft = document.querySelector("#arrow-left"),
arrowRight = document.querySelector("#arrow-right"),
current = 0;
// Clear all images
function reset() {
for (let i = 0; i < sliderImages.length; i++) {
sliderImages[i].style.display = “none”;
}
}
This is his full code btw:
https://codepen.io/bradtraversy/pen/boydaE