<script>
a=3
b=2
document.write(a+b)
</script>
<script>
a=3
b=2
document.write((a+b)*(a-b)*a/b)
document.write("<hr>")
a=5
b=1
document.write((a+b)*(a-b)*a/b)
document.write("<hr>")
a=3.14
b=0.618
document.write((a+b)*(a-b)*a/b)
document.write("<hr>")
</script>
<script>
长度 = 18
宽度 = 5
面积 = 长度 * 宽度
document.write(面积)
</script>
<script>
length = 18
width = 5
area = length * width
document.write(area)
</script>
尝试计算半径为6的圆的面积。
<script>
a = "Time"
b = " waits for no one."
document.write(a+b)
document.write("<hr>")
a = "Money"
b = " waits for no one."
document.write(a+b)
document.write("<hr>")
a = "Time"
b = " is money."
document.write(a+b)
</script>
<script>
a = 3
a = 2
age = 22
document.write(a+age)
</script>
<script>
age = 22
age = age + 1
document.write(age)
</script>
给变量名lucky_number赋予一个自己喜欢的数字。
https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Guide/Grammar_and_types#%E5%8F%98%E9%87%8F
通过查阅文档,回答常量和变量的主要区别是什么?
视频和音乐:
字体: