Merge remote-tracking branch 'origin/master'
This commit is contained in:
26
README.md
26
README.md
@ -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
Reference in New Issue
Block a user