Flussdiagramm
Numbers data type overview
Inhalt des Flussdiagramms
JavaScript Numbers Type
Numbers Data Type
Essentially numbers data type gives us the opportunity to work with numbers and perform mathematical operations and calculations with them.
For example: let a = 10; // This is how you create a number
The commonest mathematical operations are also supported in JavaScript with the use of arithmetical operators.
10 + 15 // returns 25, + is the JS addition operator
15 - 10 // returns 5, since - is the JS subtraction operator
10 * 10 // returns 100, since * is the multiplication operator
10 / 10 // returns 1, since / is the division operator
10 % 3 // returns 1, since this is the remainder of the division (10 / 3). The remainder and not the result!! This is called the modulo operator.
10 ** 2 // returns 100, this is the square of 10
100 ** (1 / 2) // returns 10, the square root of 100. See Math module for more operations like that.
parseInt('10') // converts the '10' from type string to type number 10.
parseFloat('6.5') // converts the '6.5' decimal from type string to type number 6.5
You can find out whole String documentation here!
Informationen
- Beschreibung
- Junior Certificate Web Developing (JavaScript) Flussdiagramm am Numbers data type overview, erstellt von Kostas Diakogiannis am 12/10/2018.
- Erstellt von
- Kostas Diakogiannis
- Aufrufe
- 3
- Verlauf
-
- Erstellt von Kostas Diakogiannis · 12 Okt 2018
- Kopiert von Kostas Diakogiannis · 12 Okt 2018
- Bewertung