Added a few type checking snippets from lodash

This commit is contained in:
Angelos Chalaris
2018-01-16 16:42:17 +02:00
parent 2a4572355a
commit 667f705ad7
8 changed files with 98 additions and 0 deletions

13
snippets/isArrayBuffer.md Normal file
View File

@ -0,0 +1,13 @@
### isArrayBuffer
Checks if value is classified as a ArrayBuffer object.
Use the `instanceof`operator to check if the provided value is a `ArrayBuffer` object.
```js
const isArrayBuffer = val => val instanceof ArrayBuffer;
```
```js
isArrayBuffer(new ArrayBuffer()); // true
```