<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title> 逻辑运算符 </title>
<script type="text/javascript">
var num1 = 10;
num1 += 100;//num1 = num1+100;
window.alert (num1);
var num2 = 10;
num2 -= 100;//num2 = num2- 100;
window.alert (num2);
var num3 = 10;
num3 *= 100;//num3 = num3 * 100;
window.alert (num3);
var num4 = 10;
num4 /= 100;//num4 = num4 / 100;
window.alert (num4);
var num5 = 10;
num5 %= 100;//num5 = num5 % 100;
window.alert (num5);
var a = 56;
var b = 90;
a -= 34;//a = a -34 = 22;
b %= a;//b = b / a 的余数 = 90 /22的余数 = 2
window.alert (a);
window.alert (b);
</script>
</head>
<body>
</body>
</html>
j1.png
j2.png
j3.png
j4.png
j5.png
j6.png
j7.png
网友评论