Travis build: 226

This commit is contained in:
30secondsofcode
2018-08-14 17:40:14 +00:00
parent 664c63403a
commit f8d3c5ccf5
2 changed files with 3 additions and 15 deletions

View File

@ -8286,16 +8286,10 @@ is(Boolean, new Boolean(true)); // true
Checks if the provided argument is array-like (i.e. is iterable).
Use the spread operator (`...`) to check if the provided argument is iterable inside a `try... catch` block and the comma operator (`,`) to return the appropriate value.
Check if the provided argument is not `null` and that its `Symbol.iterator` property is a function.
```js
const isArrayLike = val => {
try {
return [...val], true;
} catch (e) {
return false;
}
};
const isArrayLike = obj => obj != null && typeof obj[Symbol.iterator] === 'function';
```
<details>