Type guard that checks if a value is not a boolean.
Type Narrowing Behavior:
boolean
true
The type of the input value
The value to check
true if u is not a boolean, false otherwise. When true, TypeScript excludes boolean from the type.
u
false
const flags: unknown[] = [true, 'no', false];const nonBooleans = flags.filter(isNotBoolean);assert.deepStrictEqual(nonBooleans, ['no']); Copy
const flags: unknown[] = [true, 'no', false];const nonBooleans = flags.filter(isNotBoolean);assert.deepStrictEqual(nonBooleans, ['no']);
Type guard that checks if a value is not a boolean.
Type Narrowing Behavior:
boolean
from the input type whentrue