Did a quick search for a seemingly trivial question but to no avail. I want to basically test whether a string element in an array within another array is a number or just characters. So I convert the string using parseInt and it either returns either the 'int' or 'NaN'.
However in an if statement if I use;
if (typeof (parseInt(a_data[j][i])) == "number")
{
console.log(parseInt(a_data[j][i]) + " is a number.")
}
then after it prints out the ints it starts to print out "NaN is a number." I have gotten round this using;
if (!isNaN(parseInt(a_data[j][i])))
{
console.log(parseInt(a_data[j][i]) + " is a number.")
}
but I am wondering why it thinking NaN is a number?