Travis build: 1175
This commit is contained in:
@ -1201,8 +1201,9 @@ Returns the remaining elements.
|
||||
|
||||
```js
|
||||
const dropRightWhile = (arr, func) => {
|
||||
while (arr.length > 0 && !func(arr[arr.length - 1])) arr = arr.slice(0, -1);
|
||||
return arr;
|
||||
let rightIndex = arr.length;
|
||||
while (rightIndex-- && !func(arr[rightIndex]));
|
||||
return arr.slice(0, rightIndex + 1);
|
||||
};
|
||||
```
|
||||
|
||||
@ -4736,6 +4737,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