Search⌘ K
AI Features

Numeric Data Types and Notations

Explore the fundamental numeric data types in JavaScript, including integers and floating-point numbers. Understand how to use exponential notation and recognize the NaN value, which indicates non-numeric results. This lesson builds your foundational knowledge for handling numbers effectively in JavaScript programming.

In the last chapter, we learned all about strings. Now it’s time to learn about numbers.

Integers and floats

Numbers can be classified into various types.

Numbers can be integers, which are whole numbers, such as 33, 4-4, or 00.

Integers
Integers

Numbers can also be floating-point numbers–often referred to as just reals, decimals, or floats. These include all numbers that have fractional or decimal parts, such as 1.51.5 ...