This content originally appeared on DEV Community and was authored by 101samovar
Let’s define a function addDays.
The function has two parameters: date to be modified and number of days to add.
We use the setDate function to set the new date.
And we use the getDate function to get the current date value.
So we just add the number of days to the current date.
Here it is.
We got a date a week ago.
I hope you found this article useful, if you need any help please let me know in the comment section.
? See you next time. Have a nice day!
Subscribe to our channel:
https://www.youtube.com/c/Samovar101
This content originally appeared on DEV Community and was authored by 101samovar

101samovar | Sciencx (2021-09-21T11:50:30+00:00) How to add days to date?. Retrieved from https://www.scien.cx/2021/09/21/how-to-add-days-to-date/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.