Travis build: 1539

This commit is contained in:
30secondsofcode
2019-11-04 07:17:49 +00:00
parent e76a83f138
commit e5522dcf4c
15 changed files with 217 additions and 143 deletions

View File

@ -12,13 +12,15 @@ Otherwise assign the key's value to `obj` to use on the next iteration.
Return `false` beforehand if given key list is empty.
```js
const hasKey = (obj, keys) => {
return (keys.length > 0) && keys.every(key => {
if (typeof obj !== 'object' || !obj.hasOwnProperty(key)) return false;
obj = obj[key];
return true;
});
return (
keys.length > 0 &&
keys.every(key => {
if (typeof obj !== 'object' || !obj.hasOwnProperty(key)) return false;
obj = obj[key];
return true;
})
);
};
```