Skip to content

boolean

Nicholas Berlette edited this page Jun 19, 2025 · 1 revision

@nick/is/boolean

isBoolean

Signature

function isBoolean(it: unknown): it is boolean;

Checks if the given value is a boolean.

Parameters
Name Info
it The value to check.
Returns

true if the value is a boolean, false otherwise.

Category

Primitives

Examples

import { isBoolean } from "jsr:@nick/is/boolean";
isBoolean("true"); // false
isBoolean(true); // true
Clone this wiki locally