1 <!DOCTYPE html>
2 <html>
3 <head>
4 <meta charset="UTF-8">
5 <title></title>
6 <script type="text/javascript">
7 /*
8 * =
9 * 可以将符号右侧的值赋值给符号左侧的变量
10 *
11 * +=
12 * a += 5 等价于 a = a + 5
13 *
14 * -=
15 * a -= 5 等价于 a = a - 5
16 *
17 * *=
18 * a *= 5 等价于 a = a * 5
19 *
20 * /=
21 * a /= 5 等价于 a = a / 5
22 *
23 * %=
24 * a %= 5 等价于 a = a % 5
25 *
26 */
27
28 //------------------------------------------------------------------------
29
30 var a = 10;
31
32 //a = a + 5;
33 a += 5;
34 console.log("a = "+a);//15
35
36 a -= 5;
37 console.log("a = "+a);//10
38
39 a *= 5;
40 console.log("a = "+a);//50
41
42 a %= 3;
43 console.log("a = "+a);//2
44
45 </script>
46 </head>
47 <body>
48 </body>
49 </html>