Update addDaysToDate.md

This commit is contained in:
Angelos Chalaris
2020-11-28 19:18:29 +02:00
committed by GitHub
parent f7f56ec74d
commit 2136fa79ce

View File

@ -11,7 +11,7 @@ Calculates the date of `n` days from the given date, returning its string repres
```js
const addDaysToDate = (date, n) => {
d = new Date(date);
const d = new Date(date);
d.setDate(d.getDate() + n);
return d.toISOString().split('T')[0];
};