您的位置:首页 > 职场人生

一个有趣的js面试题目

2017-02-23 09:24 281 查看
<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>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: