Travis build: 1175

This commit is contained in:
30secondsofcode
2019-05-29 06:19:16 +00:00
parent 7db36a21d1
commit 9063fad13d
5 changed files with 12 additions and 6 deletions

View File

@ -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