JavaScript Numbers JAVASCRIPT
- JavaScript Introduction
- JavaScript Syntax
- JavaScript innerHTML
- JavaScript document.write()
- Javascript - window.alert()
- JavaScript - console.log()
- JavaScript Comments
- JavaScript Variables
- JavaScript Operators
- JavaScript Data Types
- JavaScript Functions
- JavaScript Objects
- JavaScript Events
- JavaScript Strings
- JavaScript String Methods
- JavaScript Numbers
- JavaScript Number Methods
- JavaScript Arrays
- JavaScript Array Methods
- JavaScript Sorting Arrays
- JavaScript Array Iteration
- JavaScript Date Objects
- JavaScript Date Formats
- JavaScript Get Date Methods
- JavaScript Set Date Methods
- JavaScript Math Object
- JavaScript Conditions
- JavaScript Switch
- JavaScript Loop For
- JavaScript While Loop
- JavaScript Break and Continue
- JavaScript Type Conversion
- JavaScript Errors
- JavaScript Scope
- JavaScript this Keyword
- JavaScript Classes
- JavaScript Debugging
- JavaScript - Changing CSS
- JavaScript JSON
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
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
var y = 123e-5; // 0.00123
Example
var x = 3.14; // A number with decimals
var y = 3; // A number without decimalsvar x = 123e5; // 12300000
var y = 123e-5; // 0.00123