Travis build: 1311
This commit is contained in:
@ -4507,11 +4507,11 @@ isSameDate(new Date(2010, 10, 20), new Date(2010, 10, 20)); // true
|
||||
Results in a boolean representation of a specific date.
|
||||
|
||||
Pass the specific date object firstly.
|
||||
Use `Date.getDay()` to check weekday then return a boolean.
|
||||
Use `Date.getDay()` to check weekday by using a modulo operator and then returning a boolean.
|
||||
|
||||
```js
|
||||
const isWeekday = (t = new Date()) => {
|
||||
return t.getDay() >= 1 && t.getDay() <= 5;
|
||||
return t.getDay() % 6 !== 0;
|
||||
};
|
||||
```
|
||||
|
||||
@ -4816,6 +4816,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