Files
30-seconds-of-code/snippets/isBoolean.md
2017-12-17 17:55:51 +02:00

12 lines
263 B
Markdown

### isBoolean
Checks if the given argument is a native boolean element.
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
```