Create check_for_boolean
This commit is contained in:
10
snippets/check_for_boolean
Normal file
10
snippets/check_for_boolean
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
### 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);
|
||||||
Reference in New Issue
Block a user