apps-script-utils 2.1.1 Help

nonNumberLike

function nonNumberLike(value: unknown): boolean;

nonNumberLike(value) is the same test as !isNumberLike(value), written so that a guard clause reads as a sentence rather than as a negation.

A finite number, or a string that converts to one. NaN, the infinities and the empty string are excluded, which is what separates this from a bare Number(value).

isX and nonX answer a question and never interrupt control flow; requireX and requireNonX hand the value back or throw. The scheme is explained in Validation conventions.

Parameters

Parameter

Type

Description

value

unknown

The value to check.

Returns

boolean — true when the value is not convertible to a number; otherwise false.

Examples

What passes and what does not

nonNumberLike(NaN); // => true nonNumberLike(Infinity); // => true nonNumberLike(""); // => true nonNumberLike(null); // => true nonNumberLike(1); // => false nonNumberLike("1.5"); // => false nonNumberLike(" 42 "); // => false

See also

Source

src/lang/base/nonNumberLike.ts

23 September 2026

This documentation was generated with AI (Claude) from the library's source code.