<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<script type="text/javascript">
// "use strict";
// 严格模式:严格
// 开启严格模式:"use strict"
// 注意:必须放到作用域的开头
// 变量必须申明
// let n = 1;
// console.log( n );
// 普通函数中的this,不在指向window,而是undefined
// function fn () {
// console.log(this)
// }
// fn();
// 函数形参不可以重名
// function fn (a, a) {
// // a = 1
// // a = 2
// console.log(a + a);
// }
// fn(1, 2);
</script>
</body>
</html>
JS 严格模式
最新推荐文章于 2023-09-21 14:40:03 发布