UNPKG

30-seconds-of-code

Version:
15 lines (10 loc) 270 B
### 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'; ``` ```js isBoolean(null); // false isBoolean(false); // true ```