JavaScript data type (II)

JavaScript data type and the Number isNaN


Number

  • Number: integer and floating-point representation
  • NaN: i.e. non-numerical (Not a Number) is a special value

Explanation

  1. Any operation (e.g., NaN / 10) relates to the return NaN NaN
  2. NaN is not equal to any value, including itself NaN

isNaN()

  • Syntax: isNaN (n)
  • Function: detecting whether the n "non-numerical"
  • Return value: boolean
  • Parameters: parameter n may be any type

Explanation

isNaN () value of the received, first try to convert a numerical value, and then detecting whether the non-numeric

Published 15 original articles · won praise 16 · views 218

Guess you like

Origin blog.csdn.net/qq_43133192/article/details/104888368