Basics: Input Validation - NaN

Опубликовано: 18 Июль 2026
на канале: Rocket Academy
831
0

NaN stands for "not a number", which in JavaScript is a sentinel to tell the user that a value is invalid. This typically happens when we try to perform number operations on values that cannot be easily converted to numbers, for example trying to convert a string to a number with `Number("hello")`, or multiplying the string "hello" by 3, `"hello" * 3`.

Become a software developer in 6 months with Rocket Academy's live and online coding bootcamp. Get a job or a full refund.

Explore Rocket Academy's Coding Basics course:
Coding Basics Blurb: https://rocketacademy.co/courses/basics
Coding Basics Curriculum: https://basics.rocketacademy.co
Rocket Academy: https://rocketacademy.co
Rocket Academy Facebook:   / rocketacademy.co