81
JavaScript Number isFinite() method
The JavaScript number isFinite() method determines whether the given value is a finite number. It returns true if the value is a finite number, otherwise it returns false.
Syntax
The isFinite() method is represented by the following syntax:
Parameter
num – A number to be checked.
Return
A Boolean value.
JavaScript Number isFinite() method example
Here, we will understand isFinite() method through various examples.
Example 1
Let’s see a simple example of isFinite() method.
Output:
true true true
Example 2
In this example, we will use isFinite() method with negative numbers.
Output:
true false
Example 3
Let’s see isFinite() method with some different test cases.
Output:
false false false
Next TopicJavaScript Number