303 B
303 B
title, tags
| title | tags |
|---|---|
| isBoolean | type,beginner |
Checks if the given argument is a native boolean element.
- Use
typeofto check if a value is classified as a boolean primitive.
const isBoolean = val => typeof val === 'boolean';
isBoolean(null); // false
isBoolean(false); // true