<!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>
let num = 20
function fn(){
num = 10 //全局变量来看 //强烈不允许
}
fn()
console.log(num)
function fun(x, y){
console.log(x)
}
fun(1, 2)
console.log(x) //错误
</script>
</body>
</html>
版权属于:
yu
作品采用:
《
署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0)
》许可协议授权
评论 (0)