isFinite()

  • Revision slug: JavaScript/Reference/Global_Objects/isFinite
  • Revision title: isFinite
  • Revision id: 57900
  • Created:
  • Creator: evilpie
  • Is current revision? No
  • Comment 11 words added, 2 words removed

Revision Content

Summary

Evaluates an argument to determine whether it is a finite number.

Core Global Method
Implemented in JavaScript ?
ECMAScript Edition ECMAScript ?

Syntax

isFinite(number)

Parameters

number 
The number to evaluate.

Description

isFinite is a top-level function and is not associated with any object.

You can use this method to determine whether a number is a finite number. The isFinite method examines the number in its argument. If the argument is NaN, positive infinity or negative infinity, this method returns false, otherwise it returns true.

Examples

Example: Using isFinite

You can check a client input to determine whether it is a finite number.

if (isFinite(ClientInput)) {
   /* take specific steps */
}

See also

Number.NEGATIVE_INFINITY, Number.POSITIVE_INFINITY



{{ languages( { "es": "es/Referencia_de_JavaScript_1.5/Funciones_globales/isFinite", "fr": "fr/R\u00e9f\u00e9rence_de_JavaScript_1.5_Core/Fonctions_globales/isFinite", "ja": "ja/Core_JavaScript_1.5_Reference/Global_Functions/isFinite", "pl": "pl/Dokumentacja_j\u0119zyka_JavaScript_1.5/Funkcje/isFinite" } ) }}

Revision Source

<p>
</p>
<h3 name="Summary">Summary</h3>
<p>Evaluates an argument to determine whether it is a finite number.</p>
<table class="standard-table"> <thead> <tr> <th class="header" colspan="2">Core Global Method</th> </tr> </thead> <tbody> <tr> <td>Implemented in</td> <td>JavaScript ?</td> </tr> <tr> <td>ECMAScript Edition</td> <td>ECMAScript ?</td> </tr> </tbody>
</table><h3 name="Syntax"> Syntax </h3>
<p><code>
isFinite(<i>number</i>)
</code>
</p>
<h3 name="Parameters"> Parameters </h3>
<dl><dt> <code>number</code> </dt><dd> The number to evaluate.
</dd></dl>
<h3 name="Description"> Description </h3>
<p><code>isFinite</code> is a top-level function and is not associated with any object.
</p><p>You can use this method to determine whether a number is a finite number. The <code>isFinite</code> method examines the number in its argument. If the argument is <code>NaN</code>, positive infinity or negative infinity, this method returns <code>false</code>, otherwise it returns <code>true</code>. </p>
<h3 name="Examples"> Examples </h3>
<h4 name="Example:_Using_isFinite"> Example: Using <code>isFinite</code> </h4>
<p>You can check a client input to determine whether it is a finite number.
</p>
<pre class="eval">if (isFinite(ClientInput)) {
   /* take specific steps */
}
</pre>
<h3 name="See_also"> See also </h3>
<p><a href="en/Core_JavaScript_1.5_Reference/Global_Objects/Number/NEGATIVE_INFINITY">Number.NEGATIVE_INFINITY</a>,
<a href="en/Core_JavaScript_1.5_Reference/Global_Objects/Number/POSITIVE_INFINITY">Number.POSITIVE_INFINITY</a>
</p><p><br>
</p><p><br>
</p>
<div class="noinclude">
</div>
{{ languages( { "es": "es/Referencia_de_JavaScript_1.5/Funciones_globales/isFinite", "fr": "fr/R\u00e9f\u00e9rence_de_JavaScript_1.5_Core/Fonctions_globales/isFinite", "ja": "ja/Core_JavaScript_1.5_Reference/Global_Functions/isFinite", "pl": "pl/Dokumentacja_j\u0119zyka_JavaScript_1.5/Funkcje/isFinite" } ) }}
Revert to this revision