Number literals are used to represent numerical values.
There are common types of number literals in JavaScript:
These are whole numbers without any decimal point.
let num = 42;
These are numbers with decimal points.
let floatNumber = 3.14;
JavaScript allows representing very large or very small numbers using exponential notation.
let bigNumber = 6.022e23;
let smallNumber = 1.6e-19;
Represented with 0b or 0B prefix, followed by binary digits (0 or 1).
let binaryNumber = 0b1010;