A resourceful newsletter featuring the latest and most important news, articles, books and updates in the world of #javascript π Don't miss our Quizzes!
Let's chat: @nairihar
Post #1991
6.68K
CHALLENGE
function getNextWeekday(dateString) {
const date = new Date(dateString);
const day = date.getDay();
const diff = (day === 0 ? 1 : 8) - day;
date.setDate(date.getDate() + diff);
return date.toDateString();
}
console.log(getNextWeekday('2023-10-20'));- β€ 13
- π 3
- π₯ 3
- π€ 2
- π€© 1






