I'm trying to create something like slide show that is moved automatically after a delay. I don't really understand how promises work so I find myself unable to create the sleep functinon. Any solutions?
const startBtn = document.querySelector('.startBtn');
const box = document.querySelector('.box')
startBtn.addEventListener('click', () => {
for(var i = 1; i <= 20;i++){
//sleep(60000); <= the problem
box.style.transform = 'translateY(' + (-i * 100) + 'vh)';
}
});