Behrooz
Tahanzadeh


isNember in JavaScript

I wrote this function some time ago to find out if a variable is numeric, regardless of its type. The variable could be a String that contains numeric value.


[btcode title=”java script” lang=”js”]
function isNumber(n) {
return !isNaN(parseFloat(n)) && isFinite(n);
}
[/btcode]