How can I get the next Monday in JavaScript? I can\'t find anything of this in the internet and I have also tried a lot of codes and understanding of this but I can\'t reall
let now = new Date();
let day = 1; // Monday
if (day > 6 || day < 0)
day = 0;
while (now.getDay() != day) {
now.setDate(now.getDate() + 1);
}
now.setDate(now.getDate() + 1);
console.log(now); // next Monday occurrence