Skip to content

subtract

Subtracts the provided number from the current number and returns the result. It follows normal JavaScript number behavior for decimals, Infinity, and NaN.

Usage

ts
const remaining = (10).subtract(4);

// 6

Parameters

NameTypeDescription
valuenumberValue to subtract.

Returns

The difference.

Type signature

ts
interface Number {
    subtract(value: number): number;
}

All packages are released under the MIT License.