Update snippet descriptions

This commit is contained in:
Isabelle Viktoria Maciohsek
2020-10-20 23:02:01 +03:00
parent 52880f08ee
commit caa67e2a49
63 changed files with 175 additions and 126 deletions

View File

@ -3,10 +3,10 @@ title: isWeekday
tags: date,beginner
---
Results in a boolean representation of a specific date.
Checks if the given date is a weekday.
- Pass the specific date object firstly.
- Use `Date.prototype.getDay()` to check weekday by using a modulo operator and then returning a boolean.
- Use `Date.prototype.getDay()` to check weekday by using a modulo operator (`%`).
- Omit the argument, `d`, to use the current date as default.
```js
const isWeekday = (d = new Date()) => d.getDay() % 6 !== 0;