Numbers are primitive data types. It represents using numeric literals and support both integers and floating-point numbers.
Intergers are whole numbers (0, 1, 2, …) without any fractional or decimal parts.
// Intergers
let x = 1;
let y = 33234342543;
Floating-point numbers represent real numbers and are commonly used to handle values with fractional parts or very large/small values. Significantly maximum 17 decimal digits of precision can be made in Javascript.
// float
let float1 = 5.2419; // With a decimal point
let float2 = 3.02e8; // Exponential notation
let float3 = 12e-4; // 0.0012
let float4 = 1 / 3; // 0.3333333333333333