JavaScript Numbers JAVASCRIPT

JavaScript Numbers  

JavaScript Numbers

JavaScript Numbers

JavaScript has only one type of number. Numbers can be written with or without decimals.

var x = 3.14;    // A number with decimals
var y = 3;       // A number without decimals

Extra-large or extra small numbers can be written with scientific (exponent) notation.

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

 

Example

var x = 3.14;    // A number with decimals
var y = 3;       // A number without decimals

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

Download free E-book of JAVASCRIPT


#askProgrammers
Learn Programming for Free


Join Programmers Community on Telegram


Talk with Experienced Programmers


Just drop a message, we will solve your queries