Added a few type checking snippets from lodash
This commit is contained in:
13
snippets/isMap.md
Normal file
13
snippets/isMap.md
Normal file
@ -0,0 +1,13 @@
|
||||
### isMap
|
||||
|
||||
Checks if value is classified as a Map object.
|
||||
|
||||
Use the `instanceof`operator to check if the provided value is a `Map` object.
|
||||
|
||||
```js
|
||||
const isMap = val => val instanceof Map;
|
||||
```
|
||||
|
||||
```js
|
||||
isMap(new Map()); // true
|
||||
```
|
||||
Reference in New Issue
Block a user