-
Notifications
You must be signed in to change notification settings - Fork 0
/
js面试.html
42 lines (32 loc) · 864 Bytes
/
js面试.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<div>
</div>
<script type="text/javascript">
//https://github.com/Wscats/Good-text-Share/issues/85
//http://wiki.jikexueyuan.com/project/brief-talk-js/static-attributes-and-prototype-properties.html
console.log(n)
function Foo() {
getName = function() { alert(1); };
return this;
}
// Foo.getName = function() { alert(2); };
Foo.prototype.getName = function() { alert(3); };
// var getName = function() { alert(4); };
// function getName() { alert(5); }
//请写出以下输出结果:
// Foo.getName();
// getName();
// window.getName();
// getName();
// new Foo.getName();
// new Foo().getName();
// new new Foo().getName();
</script>
</body>
</html>