paint-brush
Checking if a Value is a Number in Javascript with isNaN()by@smpnjn
523 reads
523 reads

Checking if a Value is a Number in Javascript with isNaN()

by Johnny Simpson4mFebruary 6th, 2023
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

In Javascript, we have numerous ways to check if something is or is not a number. This is a particularly common task in Javascript, where there is dynamic typing, resulting in some unexpected things being classified as numbers. Introducing isNaN, a special value in Javascript which stands for "Not a Number" In this guide we'll cover how to check whether something is a number, and the pitfalls you should avoid.
featured image - Checking if a Value is a Number in Javascript with isNaN()
Johnny Simpson HackerNoon profile picture
Johnny Simpson

Johnny Simpson

@smpnjn

Product, Engineering, Web

About @smpnjn
LEARN MORE ABOUT @SMPNJN'S
EXPERTISE AND PLACE ON THE INTERNET.
L O A D I N G
. . . comments & more!

About Author

Johnny Simpson HackerNoon profile picture
Johnny Simpson@smpnjn
Product, Engineering, Web

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite