请老师检查
来源:2-33 编程练习
KangarooL
2021-03-27 19:59:15
相关代码:
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title> ++和--的运算</title>
</head>
<body>
<script>
//代码补充
var x = 4, y = 5, result;
result = (x++) + (--y);
console.log('(x++) + (--y) =' + result); //8
result = (x++) - (--y);
console.log('(x++) - (--y) =' + result); //2
result = (x++) * (--y);
console.log('(x++) * (--y) =' + result); //12
result = (x++) / (--y);
console.log('(x++) / (--y) =' + result); //7
result = (x++) % (--y);
console.log('(x++) % (--y) =' + result); //NaN
</script>
</body>
</html>
1回答
好帮手慕慕子
2021-03-28
同学你好,代码实现是正确的,继续加油,祝学习愉快~