一、运行结果
二、代码示例
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>算术运算符的使用</title> <style type="text/css"> body{ font-family:楷体; font-size:24px; } </style> </head> <body> <script type="text/javascript"> var x=11,y=5,z=8; document.write("x=11;y=5;z=8"); document.write("<br>"); document.write("y++的值为:",y++); document.write("<br>"); document.write("z--的值为:",z--); document.write("<br>"); document.write("++z的值为:",++z); document.write("<br>"); document.write("++y的值为:",++y); document.write("<br>"); document.write("--z的值为:",--z); document.write("<br>"); document.write("--y的值为:",--y); document.write("<br>"); document.write("--x的值为:",--x); document.write("<br>"); document.write("x++的值为:",x++); document.write("<br>"); </script> </body> </html>
最后
以上就是犹豫往事最近收集整理的关于算术运算符的使用(JavaScript)的全部内容,更多相关算术运算符内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复