Namespace: Basic:isNaN

Basic:isNaN

Source:

Methods

isNaN(expression, checkForIdentityopt) → {Boolean}

Returns if an expression is NaN or not. This method employs two different approaches: By default it really checks if the expression is the value NaN or not, this being a valid JS-value for something. In JS this gets checked by comparing an expression with itself on identity, since NaN is the only value not being identical to itself. If you set checkForIdentity to false, this method will use the standard JS-isNaN, which inspects the expression, tries to cast or parse a number from it and returns the result.

Parameters:
Name Type Attributes Default Description
expression *

the expression to check

checkForIdentity Boolean <optional>
true

set to false if you want to use default JS-functionality

Source:
Returns:
true if expression is NaN
Type
Boolean
Example
if( !isNaN(suspiciousCalculatedValue) ){
  return suspiciousCalculatedValue * 3;
}