typeof
to check if a value is classified as a boolean primitive.const isBoolean = val => typeof val === 'boolean';
isBoolean(null); // false
isBoolean(false); // true
Subscribe to get resources directly to your inbox. You won't receive any spam! ✌️