Created
April 13, 2017 15:30
-
-
Save dawncold/72a61e596611c509ec15d007738899c0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | |
Foo().getName(); | |
getName(); | |
new Foo.getName(); | |
new Foo().getName(); | |
new new Foo().getName(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment