countWeekDaysBetween
Counts the weekdays between two dates.
- Use
Array.from()to construct an array withlengthequal to the number of days betweenstartDateandendDate. - Use
Array.prototype.reduce()to iterate over the array, checking if each date is a weekday and incrementingcount. - Update
startDatewith the next day each loop usingDate.prototype.getDate()andDate.prototype.setDate()to advance it by one day. - NOTE: Does not take official holidays into account.