Update and rename check_for_boolean.md to check-for-boolean-primitive-values.md

This commit is contained in:
Angelos Chalaris
2017-12-14 11:32:08 +02:00
committed by GitHub
parent 65a70a1ed6
commit 38e5a30585
2 changed files with 8 additions and 10 deletions

View File

@ -0,0 +1,8 @@
### Check for boolean primitive values
Use `typeof` to check if a value is classified as a boolean primitive.
```js
const isBool = val => typeof val === 'boolean';
// isBool(null) -> false
```

View File

@ -1,10 +0,0 @@
### Check for Boolean Primitive Values
Check if a value is classified as a boolean primitive. Return true or false.
function booWho(bool) {
return typeof bool === 'boolean';
}
// test here
booWho(null);