Fluxograma
Numbers data type overview
Conteúdo do fluxograma
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!
Informações
- Descrição
- Junior Certificate Web Developing (JavaScript) Fluxograma sobre Numbers data type overview, criado por Kostas Diakogiannis em 12-10-2018.
- Criado por
- Kostas Diakogiannis
- Visualizações
- 3
- Histórico
-
- Criado por Kostas Diakogiannis · 12 out 2018
- Copiado por Kostas Diakogiannis · 12 out 2018
- Avaliação