Methods
isInt(intVal) → {Boolean}
Returns if a value is truly a real integer value and not just an int-parsable value for example. Since JS only knows the data type "number" all numbers are usable as floats by default, but not the other way round.
Parameters:
Name | Type | Description |
---|---|---|
intVal |
* | the value the check |
Returns:
true if intVal is a true integer value
- Type
- Boolean
Example
if( !isInt(val) ){
val = parseInt(val, 10);
}