I have a variable var number="1234"
, though the number is a numeric value but it is between ""
so when I check it using typeof
or by NaN
I got it as a string .
function test()
{
var number="1234"
if(typeof(number)=="string")
{
alert("string");
}
if(typeof(number)=="number")
{
alert("number");
}
}
I got always alert("string")
, can you please tell me how can I check if this is a number?