JS Built-ins
GlobalFunctionsparseFloatbeginner

parseFloat β€” non-numeric string returns NaN

πŸ“– Usage Example
parseFloat('abc')          // β†’ NaN
isNaN(parseFloat('abc'))   // β†’ true

parseFloat() returns NaN when the string cannot be converted to a number.

parseFloat NaN

parseFloat('abc') returns NaN.

Challenge: Verify that isNaN(parseFloat('abc')) is true.

πŸ’‘ Hints (1)
  • β€’ NaN is returned when a string cannot be converted to a number.