Number

Number.isFinite

Determines whether the passed value is a finite number — not Infinity, -Infinity, or NaN

Syntax

JavaScript
Number.isFinite(value)

Parameters

ParameterTypeDescription
valueanyThe value to be tested

Return Value

true if the value is a finite number, false otherwise

Examples

Basic Usage
console.log(Number.isFinite(42)); // true
console.log(Number.isFinite(Infinity)); // false
console.log(Number.isFinite(NaN)); // false
Practical Example
console.log(Number.isFinite('42')); // false (unlike global isFinite)
console.log(isFinite('42' as any)); // true
Advanced Usage
function safeDiv(a: number, b: number) {
  const result = a / b;
  return Number.isFinite(result) ? result : 0;
}
console.log(safeDiv(10, 0)); // 0

Understanding Number.isFinite

The Number.isFinite method in JavaScript determines whether the passed value is a finite number — not Infinity, -Infinity, or NaN. It belongs to the Number object and is one of the most widely used methods for working with number values in modern JavaScript and TypeScript applications.

The method signature is Number.isFinite(value). It accepts 1 parameter: value. When called, it returns true if the value is a finite number, false otherwise. Understanding when and how to use isFinite() helps you write more expressive, readable code.

Common use cases for Number.isFinite include data transformation, input validation, API response processing, and building reusable utility functions. It works well alongside related methods like number-isnan, number-isinteger, number-issafeinteger, enabling you to chain operations together for complex data manipulation pipelines.

Browser support for Number.isFinite is excellent across all modern browsers including Chrome, Firefox, Safari, and Edge. It is also fully supported in Node.js and Deno. For older environments, transpilation with Babel or a polyfill may be needed.

Browser Compatibility

Supported in all modern browsers (Chrome, Firefox, Safari, Edge) and Node.js. Part of the ECMAScript standard.

Related Methods

More Number Methods

Other methods in the Number object

Related Tools

More Number Methods

Explore JavaScript Methods

Browse our complete reference of 410 JavaScript methods with syntax, examples, and explanations.