<html>
<head><title>Using the const Keyword</title>
<script type="text/javascript">
const NOON = 12;
const FREEZING = 32; // Can't change
</script>
</head>
<body bgcolor="silver">
<big>
<script type="text/javascript">
document.write("Fahrenheit temp is " + FREEZING + ".<br />");
FREEZING =32 + 10;
NOON = NOON + " noon";
document.write("Make it warmer " + FREEZING + ".<br />");
document.write("See you at ", NOON, ".<br />");
</script>
</big>
</body>
</html>
以上代码在 Firefox、Chrome、Safari 上运行良好,但不适用于 Opera 12.02。由于我使用了关键字 'const' 结果应该如下
华氏温度是 32。让它变暖 32。12 点见。
但是Opera浏览器显示
华氏温度是 32。让它变暖 42。中午 12 点见。
这里有什么问题。