function getSundayOfNextWeek() {
const today = new Date();
const first = today.getDate() - today.getDay() + 1;
const last = first + 6;
const sunday = new Date(today.setDate(last));
return sunday;
}
console.log(getSundayOfNextWeek().toDateString());
/*
run:
"Sun Apr 17 2022"
*/