change html text based on date......JS
You can do:

changeText = () =&gt; {
    firstDay.textContent = weekday[(day + 1) % 7]
    secondDay.textContent = weekday[(day + 2) % 7]
    thirdDay.textContent = weekday[(day + 3) % 7]
    fourthDay.textContent = weekday[(day + 4) % 7]
    fifthDay.textContent = weekday[(day + 5) % 7]
}


Also I'd recommend passing day as a parameter. Just so that it's more clear.