Update isWeekday.md
This commit is contained in:
committed by
GitHub
parent
c8c73e06f5
commit
6d1bb5e8d9
@ -9,7 +9,7 @@ Results in a boolean representation of a specific date.
|
|||||||
- Use `Date.getDay()` to check weekday by using a modulo operator and then returning a boolean.
|
- Use `Date.getDay()` to check weekday by using a modulo operator and then returning a boolean.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const isWeekday = (t = new Date()) => t.getDay() % 6 !== 0;
|
const isWeekday = (d = new Date()) => d.getDay() % 6 !== 0;
|
||||||
```
|
```
|
||||||
|
|
||||||
```js
|
```js
|
||||||
|
|||||||
Reference in New Issue
Block a user