In jQuery, there are several ways to determine whether an object is a number or whether it can be converted to a number.First, jQuery. isNaN () has been removed from the latest version (after 1.7) and replaced by jQuery. isNumeric (). This is not
In jQuery, there are several ways to determine whether an object is a number or whether it can be converted to a number.First, jQuery. isNaN () has been removed from the latest version (after 1.7) and replaced by jQuery. isNumeric (). This is not
1. Misunderstanding correction of attribute NanNan (not a number) defines a non-numeric special value in the list of numbers, and it has an object that does not have the value of any non-numeric type equal to Nan, only if the arithmetic operation
The isNaN function returns a Boolean value indicating whether the provided value is a reserved value, NaN (not a number ).
IsNaN Function
Returns a Boolean value indicating whether the provided value is a reserved value NaN (not a number ).
NaN:
In jquery, there are several ways to determine whether an object is a number or if it can be converted to a number.First, Jquery.isnan () has been removed (after 1.7) in the latest version and replaced by Jquery.isnumeric (). This is not surprising,
IsNaN Function Returns a Boolean value indicating whether the provided value is a reserved value NaN (not a number ).NaN: Not a NumberIsNaN (numValue)The required numvalue parameter is the value to check whether it is NAN.Description If the value is
isNaN function
Returns a Boolean value that indicates whether the supplied value is a reserved value NaN (not a number).
NaN is not a number
isNaN (NumValue)
The required NumValue parameter is the value to check for NAN.
Description
If the
Nan is not a numberThe IsNaN () function attempts to convert the value to a numeric value after it has been received.1 alert (IsNaN (NaN)); // true 2 alert (IsNaN); // false, 25 is a numeric value 3 alert (IsNaN (')) //false, ' 25 ' can be
In JavaScript, the method of determining whether a variable is a number is mainly about the isNaN () function in JavaScript.
Function:
The isNaN () function checks whether its arguments are non-numeric values.
Grammar:
isNaN (x) x is
IsNaN (): Used to check if the parameter is a non-numeric value. Tip: Non-digital OH. (Not a number)document.write (IsNaN (0))//return Falsedocument.write (IsNaN (5-2))//return Falsedocument.write (IsNaN ("Hello"))//return TrueThe isfinite (number)
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.