Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请写出下面代码的执行结果 #390

Open
lgwebdream opened this issue Jul 6, 2020 · 1 comment
Open

请写出下面代码的执行结果 #390

lgwebdream opened this issue Jul 6, 2020 · 1 comment
Labels
JavaScript teach_tag

Comments

@lgwebdream
Copy link
Owner

lgwebdream commented Jul 6, 2020

function Foo() {
  getName = function () {
    alert(1);
  };
  return this;
}
getName();
Foo.getName = function () {
  alert(2);
};
Foo.prototype.getName = function () {
  alert(3);
};
getName = function () {
  alert(4);
};

// 请写出下面的输出结果
getName();
Foo.getName();
new Foo().getName();
@lgwebdream lgwebdream added the JavaScript teach_tag label Jul 6, 2020
@lgwebdream
Copy link
Owner Author

扫描下方二维码,获取答案以及详细解析,同时可解锁800+道前端面试题。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
JavaScript teach_tag
Projects
None yet
Development

No branches or pull requests

1 participant