I have this small piece of code to check if a variable is a number or not, but does not work
var cost_value= 7777;
alert(cost_value);
if (typeof(cost_value) !== "number") {
alert("not a number");//7777
} else {
alert("a number");
}
But it will always alert as a "not a number"
change to if(jQuery.type(cost_value) !== "number"
Does not work, any ideas?