Travis build: 1313
This commit is contained in:
@@ -4531,11 +4531,11 @@ isWeekday(); // true (if current date is 2019-07-19)
|
||||
Results in a boolean representation of a specific date.
|
||||
|
||||
Pass the specific date object firstly.
|
||||
Use `Date.getDay()` to check weekend then return a boolean.
|
||||
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() === 0 || t.getDay() === 6;
|
||||
return t.getDay() % 6 === 0;
|
||||
};
|
||||
```
|
||||
|
||||
@@ -4817,6 +4817,7 @@ const checkProp = (predicate, prop) => obj => !!predicate(obj[prop]);
|
||||
|
||||
|
||||
|
||||
|
||||
const lengthIs4 = checkProp(l => l === 4, 'length');
|
||||
lengthIs4([]); // false
|
||||
lengthIs4([1,2,3,4]); // true
|
||||
|
||||
Reference in New Issue
Block a user