JavaScript Number
JavaScript Number
//ADDING.
//SUBTRACTING.
//MULTIPLY.
//DIVISION.
//MODULO.
var e = 17%4; /*now this is a modulo. it's like divisioning, but when the 4 cant divison 17, the rest is 1
right? and the result will be that 1*/
console.log(a, d, c, d, e); //this will show you all of the arithmetic value result. Also, all of these
arithmetic can give you a decimal result.
//ok and now i'll show you the combinations of the arithmetic i've just explained.
var cost = 3+5*2; //this will make the 5 multiply 2 is going to the first calculated arithmetic, and after
that process the adding arithmetic will be proceed. The result will be 13.
var cast = (2+5)*3; //now with this set of parentheses the adding arithmetic will be calculated first
and then followed by the multiply arithmetic. The result will be 21.
//now this is the excercise that called Dog Age to Human Age Formula
console.log(humanAge);
//INCREMENT.
var x = 6;
x++;
//DECREMENT.
var y = 5;
y--;
console.log(x, y);
//with the ++ and == method you can only increase the value by one, and if you want to increase the
value more than one, you can do it like this:
x += 2;
y -= 4;
console.log(x, y); //you can even use the variable as the value, or maybe use /= or *=. Example:
x += y;
y *= x;