Get the App
SLTechnology News&Howtos  ›  Development  › 

What is the function of javascript's isNaN?

Shulou Source: shulou.com Published: 2022-06-02 01:45:35 10月21日 Update

This article mainly introduces the javascript isNaN what the role of the relevant knowledge, the content is detailed and easy to understand, the operation is simple and fast, with a certain reference value, I believe you will have a harvest after reading this javascript isNaN article, let's take a look at it.

Javascript's isNaN is a built-in function to check whether its argument is a non-numeric value. Its syntax is "isNaN (value)", and the parameter value specifies the value to be detected.

This article operating environment: Windows7 system, javascript1.8.5 version, Dell G3 computer.

What is the isNaN of javascript?

The isNaN () function is used to check whether its parameters are non-numeric.

Returns true if the parameter value is NaN or non-numeric values such as string, object, undefined, etc., otherwise it returns false.

Grammar

IsNaN (value)

Parameters.

Value is required. The value to detect.

All major browsers support the isNaN () function

Example

Check whether the number is illegal:

[xss_clean] (isNaN (123) + "

[xss_clean] (isNaN (- 1.23) + "

[xss_clean] (isNaN (5-2) + "

"); [xss_clean] (isNaN (0) +"

"); [xss_clean] (isNaN (" Hello ") +"

[xss_clean] (isNaN ("2005-12-12") + "

")

The output result of the above example:

This is the end of falsefalsefalsefalsetruetrue's article on "what is the role of javascript's isNaN?". Thank you for reading! I believe you all have a certain understanding of the knowledge of "what is the role of javascript's isNaN". If you want to learn more knowledge, you are welcome to follow the industry information channel.

Tags: Parameters functions numbers functions knowledge checks content examples right and wrong articles grammar detection values characters strings objects easy to operate articles easy to understand more Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft Shulou Information MariaDB Docker Xiaomi