这个作业属于哪个课程 | https://edu.cnblogs.com/campus/sdscfz/SF4 |
---|---|
这个作业要求在哪里 | https://edu.cnblogs.com/campus/sdscfz/SF4/homework/12940 |
这个作业的目标 | 第二次作业-交换两个变量的值 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script>
var num1 = 10
var num2 = 20
var temp
temp = num1
num1 = num2
num2 = temp
console.log(num1, num2)
document.write(`num1值是:${num1}<br>num2值是:${num2}`)
</script>
</body>
</html>