【腾讯云】云产品限时秒杀,爆款1核2G云服务器,首年99元

一个有趣的js面试题目

<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>

 

posted @ 2017-02-23 09:24  happenzh  阅读(275)  评论(0)    收藏  举报