Update isWeekend.md
This commit is contained in:
committed by
GitHub
parent
6d1bb5e8d9
commit
5169b41c1b
@ -9,8 +9,8 @@ Results in a boolean representation of a specific date.
|
||||
- Use `Date.getDay()` to check weekend based on the day being returned as 0 - 6 using a modulo operation then return a boolean.
|
||||
|
||||
```js
|
||||
const isWeekend = (t = new Date()) => {
|
||||
return t.getDay() % 6 === 0;
|
||||
const isWeekend = (d = new Date()) => {
|
||||
return d.getDay() % 6 === 0;
|
||||
};
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user