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
var closestMonday = () => {
var curr_date = new Date(); // current date
var day_info = 8.64e+7; // milliseconds per day
var days_to_monday = 8 - curr_date.getDay(); // days left to closest Monday
var monday_in_sec = curr_date.getTime() + days_to_monday * day_info; // aleary Monday in seconds from 1970
var next_monday = new Date(monday_in_sec); // Monday in date object
next_monday.setHours(0,0,0);
return next_monday;
}