Merge remote-tracking branch 'origin/master'

This commit is contained in:
Angelos Chalaris
2018-01-23 20:17:37 +02:00
2 changed files with 32 additions and 1 deletions

View File

@ -346,6 +346,7 @@ average(1, 2, 3);
* [`isNull`](#isnull)
* [`isNumber`](#isnumber)
* [`isObject`](#isobject)
* [`isObjectLike`](#isobjectlike)
* [`isPlainObject`](#isplainobject)
* [`isPrimitive`](#isprimitive)
* [`isPromiseLike`](#ispromiselike)
@ -5780,6 +5781,31 @@ isObject(true); // false
<br>[⬆ Back to top](#table-of-contents)
### isObjectLike
Checks if a value is object-like.
Check if the provided value is not `null` and its `typeof` is equal to `'object'`.
```js
const isObjectLike = val => val !== null && typeof val === 'object';
```
<details>
<summary>Examples</summary>
```js
isObjectLike({}); // true
isObjectLike([1, 2, 3]); // true
isObjectLike(x => x); // false
isObjectLike(null); // false
```
</details>
<br>[⬆ Back to top](#table-of-contents)
### isPlainObject
Checks if the provided value is an bbject created by the Object constructor.

File diff suppressed because one or more lines are too long