I want to display an array of slides and each slide has a value which tells the programm how long it should be displayed for. Since the slides are stored in an array I thought about just looping through the array, display the current slide and then just wait the amount of time at the end before looping again.
So this is my attempt:
for (let i= 0; i < this.slides.length; i++) {
setTimeout(() => {
this.currentSlide = this.slides[i]
}, this.slides[i].slidetime * 1000);
}
I even tried doing it like this:
for (let i= 0; i < this.slides.length; i++) {
this.currentSlide = this.slides[i];
this.wait(this.slides[i].slidetime);
}
wait(seconds) {
setTimeout(() => {}, seconds * 1000);
}
But it didn't make a difference.