Neh*_*pta 2 html javascript function
例如:
<!DOCTYPE html>
<html>
<head>
<title>TEST PAGE</title>
<script type="text/javascript">
"use strict";
function a () {
i = 0;
}
</script>
<body>
<div> TEST </div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
为什么这个html页面在浏览器中执行时没有产生"变量未定义"错误,strict mode启用了?
小智 5
因为你永远不会执行a功能.
| 归档时间: |
|
| 查看次数: |
104 次 |
| 最近记录: |