addWeekDays
Calculates the date after adding the given number of business days.
- Use
Array.from()to construct an array withlengthequal to thecountof business days to be added. - Use
Array.prototype.reduce()to iterate over the array, starting fromstartDateand incrementing, usingDate.prototype.getDate()andDate.prototype.setDate(). - If the current
dateis on a weekend, update it again by adding either one day or two days to make it a weekday. - NOTE: Does not take official holidays into account.