Reputation: 1887
I have been reading people recommending using "use strict" option. As mentioned here
every major browser supports strict mode in their latest version, including Internet Explorer 10 and Opera 12. I wanted to test it with IE10 and i have following code segemnt. IE 10 /FF did not gave any error message. What am i missing ? How do i test that "use strict" is actually working if i make any mistake ?
<html>
<head>
<script type = "text/javascript">
"use strict";
function doSomething(value1, value1, value3) {
alert('hello');
}
</script>
</head>
<body>
hello
</body>
</html>
Upvotes: 3
Views: 954
Reputation: 104780
firefox throws 'duplicate formal argument value1',
IE10 throws 'Duplicate formal parameter names not allowed in strict mode'
Upvotes: 0
Reputation: 140060
You can see in this example that Chrome actually complains about the duplicate argument name:
Upvotes: 2