一、运行结果
二、代码示例
<!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>