JavaScript Numbers

Lesson Progress
0% Complete

JavaScript has only one type of numbers.

Numbers can be written with, or without decimals:


var x1 = 34.00;     // Written with decimals
var x2 = 34;        // Written without decimals

Extra large or extra small numbers can be written with scientific (exponential) notation:


var y = 123e5;      // 12300000
var z = 123e-5;     // 0.00123

You will learn more about numbers later in this tutorial.

Skip to toolbar