Skip to content

isBoolean() function

Returns true if n is a Boolean.

Signature:

typescript
isBoolean: <T>(input: T) => input is T & boolean

Example

ts
isBoolean(true); // true
isBoolean(null); // false
isBoolean("FxTS"); // false

Open Source Code

Released under the Apache-2.0 License.