Checks if the provided value is boolean (basically true or false)
true
false
This is a type-safe equivalent to typeof x === 'boolean'.
typeof x === 'boolean'
The value to check.
isBool(true); // => trueisBool(false); // => trueisBool('true'); // => falseisBool(undefined); // => falseisBool(null); // => false Copy
isBool(true); // => trueisBool(false); // => trueisBool('true'); // => falseisBool(undefined); // => falseisBool(null); // => false
Checks if the provided value is boolean (basically
trueorfalse)This is a type-safe equivalent to
typeof x === 'boolean'.