November 24, 2016, Thursday
First, theoretical knowledge:
1. An equal sign = delegate assignment;
2. Sequence of operations: from right to left;
3. Mathematical operators: +-*%/^;
4. Scientific notation: 1E3;
Second, the experiment Code:
650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M01/8A/AC/wKiom1g2yZzjjZMVAAE9LU_ZGCs101.png-wh_500x0-wm_3 -wmp_4-s_1060662351.png "title=" 2016-11-24_190512.png "alt=" Wkiom1g2yzzjjzmvaae9lu_zgcs101.png-wh_50 "/>
Third, the theory:
1.a++ equals a =a+1;
The order of a++ is first assigned and then calculated.
Code:
<script>
var a = 10;
var b = 1;
A = a+1;
b =++a;
document.write (a);
</script>
2. String connector: +
<script>
var Varnaisa = "1";
var Varliao = "11 Today";
Number converted to string output: 111 today.
var a = 1+ "11 Today";
var A=varnaisa+varliao;
document.write (a);
</script>
Iv. Mathematical Functions, fractional rounding:
Math.ceil: All to the upward position.
Code:
<script>
var a=1.009;
var b=math.ceil (a);
document.write (b);
</script>
2.math.round: Rounds rounding.
Code:
<script>
var a=1.94;
var b=math.round (a);
document.write (b);
</script>
3.math.floor: rounding
Code:
<script>
var a=1.94;
var B=math.floor (a);
document.write (b);
</script>
Mathematics function, Pi
Expression: Math.PI;
Code:
<script>
var a=50;
var B=math.pi;
var Varint=a*a*math.pi;
document.write (varint);
</script>
Six, extract a substring:
Expression: String.substr
Code:
<script>
var a= "7853.981633974483";
var b=a.substr (0,10);
document.write (b);
</script>
Seven, calculate how many times the equation:
Expression: Math.pow;
Code:
<script>
var a=math.pow (2,10);
document.write (a);
</script>
About JS knowledge, math (Math object)