首页 > 其他 > 详细

"use strict"

时间:2014-10-11 09:40:36      阅读:265      评论:0      收藏:0      [点我收藏+]
"use strict";
//严格模式
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
</head>
<body>
<script>
"use strict";
(function() {  
     var a = b = 5;
})();
//这个会报错哦; console.log(b); </script> </body> </html>

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
</head>
<body>
<script>
(function() {  
     var a = b = 5;
})();
//这个居然跑出来一个5,尼玛!! console.log(b); </script> </body> </html>

  

"use strict"

原文:http://www.cnblogs.com/diligenceday/p/4018340.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!