mozilla

Revision 57902 of isFinite()

  • Revision slug: JavaScript/Reference/Global_Objects/isFinite
  • Revision title: isFinite
  • Revision id: 57902
  • Created:
  • Creator: XP1
  • Is current revision? No
  • Comment 5 words added, 3 words removed

Revision Content

 

Summary

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

Core Global Method
Implemented in JavaScript 1.3
ECMAScript Edition ECMAScript 2

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 function to determine whether a number is a finite number. The isFinite function 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 id="Summary" 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 1.3</td> </tr> <tr> <td>ECMAScript Edition</td> <td>ECMAScript 2</td> </tr> </tbody>
</table>
<h3 id="Syntax" name="Syntax">Syntax</h3>
<p><code>isFinite(<em>number</em>) </code></p>
<h3 id="Parameters" name="Parameters">Parameters</h3>
<dl> <dt><code>number</code></dt> <dd>The number to evaluate.</dd>
</dl>
<h3 id="Description" 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 function to determine whether a number is a finite number. The <code>isFinite</code> function 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 id="Examples" name="Examples">Examples</h3>
<h4 id="Example:_Using_isFinite" 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 id="See_also" name="See_also">See also</h3>
<p><a href="/en/JavaScript/Reference/Global_Objects/Number/NEGATIVE_INFINITY" title="en/JavaScript/Reference/Global_Objects/Number/NEGATIVE_INFINITY">Number.NEGATIVE_INFINITY</a>, <a href="/en/JavaScript/Reference/Global_Objects/Number/POSITIVE_INFINITY" title="en/JavaScript/Reference/Global_Objects/Number/POSITIVE_INFINITY">Number.POSITIVE_INFINITY</a></p>
<p> </p>
<p> </p> <p>{{ 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" } ) }}</p>
Revert to this revision