I recently came across this problem and can\'t find a good answer anywhere (hence the question).
I want to restart the loop once i reach the end yet only loop a finite a
If you want [tomorrow, tomorrow + 1, ..., tomorrow + 6]:
for (let i = 1; i <= 7; i++) { week.push(dayNames[(dayNum + i) % 7]); }