gpt4 book ai didi

javascript - 使用严格 : How to test it?

转载 作者:行者123 更新时间:2023-11-29 15:01:21 24 4
gpt4 key购买 nike

我一直在阅读推荐使用“使用严格”选项的人。如前所述 here

每个主流浏览器都在其最新版本中支持严格模式,包括 Internet Explorer 10 和 Opera 12。我想用 IE10 对其进行测试,我有以下代码段。 IE 10/FF 没有给出任何错误信息。我错过了什么?如果我犯了任何错误,我该如何测试“use strict”是否真的有效?

<html>
<head>
<script type = "text/javascript">
"use strict";
function doSomething(value1, value1, value3) {
alert('hello');
}
</script>
</head>
<body>
hello
</body>
</html>

最佳答案

在此示例中,您可以看到 Chrome 实际上会提示重复的参数名称:

http://jsfiddle.net/vANfY/

关于javascript - 使用严格 : How to test it?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9840643/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com