Added isX functions

This commit is contained in:
Angelos Chalaris
2017-12-14 12:56:02 +02:00
parent 3b0a8885cc
commit 2346be5267
7 changed files with 100 additions and 18 deletions

9
snippets/is-boolean.md Normal file
View File

@ -0,0 +1,9 @@
### Is boolean
Use `typeof` to check if a value is classified as a boolean primitive.
```js
const isBoolean = val => typeof val === 'boolean';
// isBoolean(null) -> false
// isBoolean(false) -> true
```