×

Index

JavaScript Tutorial

JavaScript Examples

CSS Tutorial

CSS Examples

Number isFinite() Method with Example in JavaScript

JavaScript Number isFinite() Method: Here, we are going to learn about the isFinite() method in JavaScript with Example.
Submitted by IncludeHelp, on February 08, 2019

Number isFinite() Method

isFinite() Method is a Number method in JavaScript, it is used to check whether a given number is a finite number or not.

It returns true if a given number is a finite number, otherwise, it returns false.

Syntax

Number.isFinit(number);

Here, number is a value/number to be checked.

Example

Input: 10
Output: true

Input: 10.23
Output: true

Input: 'Hello'
Output: false

Example - Use of Number isFinite() Method

<html>
<head>
<title>JavaScipt Example</title>
</head>
<body>
<script>		
	document.write(Number.isFinite(NaN) + "<br>");
	document.write(Number.isFinite(0/0) + "<br>");
	document.write(Number.isFinite(10) + "<br>");
	document.write(Number.isFinite(10.23) + "<br>");
	document.write(Number.isFinite(0) + "<br>");
	document.write(Number.isFinite('') + "<br>");
	document.write(Number.isFinite('Hello') + "<br>");
	document.write(Number.isFinite('08/02/2019') + "<br>");
	
</script>
</body>
</html>

Output

true
true
false
false
false
false
false
false

JavaScript Number Object Methods »




Comments and Discussions!

Load comments ↻





Copyright © 2024 www.includehelp.com. All rights reserved.