1function addDays(originalDate, days){
2 cloneDate = new Date(originalDate.valueOf());
3 cloneDate.setDate(cloneDate.getDate() + days);
4 return cloneDate;
5}
6
7let appointment = new Date("February 12, 2021 00:00:00");
8let newAppointment = addDays(appointment, 7);
9
10console.log(appointment.getDate()); // 12
11console.log(newAppointment.getDate()); // 19