首页 > Web开发 > 详细

一个有趣的js面试题目

时间:2017-02-23 11:40:41      阅读:175      评论:0      收藏:0      [点我收藏+]
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Document</title>
  <script type="text/javascript">
  function a() {
    b = function() {
      alert(1);
    };
    return this;
  }
  a.b = function() {
    alert(2);
  }
  a.prototype.b = function() {
    alert(3);
  }
  var b = function() {
    alert(4);
  }

  function b() {
    alert(5);
  }
  a.b();  
  b();  
  a().b();  
  b();  
  new a.b();  
  new a().b();  
  new new a().b();  
  </script>
</head>

<body>
  <div>
  </div>
</body>

</html>

 

一个有趣的js面试题目

原文:http://www.cnblogs.com/happen-/p/6431932.html

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