Update snippet descriptions

This commit is contained in:
Isabelle Viktoria Maciohsek
2020-10-18 20:24:28 +03:00
parent 852ad3cc5f
commit b5952d7d14
13 changed files with 18 additions and 13 deletions

View File

@ -8,6 +8,7 @@ Returns the weekday count between two dates.
- Use `Array.from()` to construct an array with `length` equal to the number of days between `startDate` and `endDate`.
- Use `Array.prototype.reduce()` to iterate over the array, checking if each date is a weekday and incrementing `count`.
- Update `startDate` with the next day each loop using `Date.getDate()` and `Date.setDate()` to advance it by one day.
- **NOTE:** Does not take official holidays into account.
```js
const countWeekDaysBetween = (startDate, endDate) =>