Type guard that checks if a value is not a number.
Type Narrowing Behavior:
number
true
The type of the input value
The value to check
true if u is not a number, false otherwise. When true, TypeScript excludes number from the type.
u
false
const mixed: unknown[] = [1, '2', 3];const nonNumbers = mixed.filter(isNotNumber);assert.deepStrictEqual(nonNumbers, ['2']); Copy
const mixed: unknown[] = [1, '2', 3];const nonNumbers = mixed.filter(isNotNumber);assert.deepStrictEqual(nonNumbers, ['2']);
Type guard that checks if a value is not a number.
Type Narrowing Behavior:
number
from the input type whentrue