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

当new一个构造函数时内部发生了什么 #57

Open
zhuguly-zz opened this issue Jul 31, 2020 · 0 comments
Open

当new一个构造函数时内部发生了什么 #57

zhuguly-zz opened this issue Jul 31, 2020 · 0 comments

Comments

@zhuguly-zz
Copy link
Owner

  1. 创建一个临时的空对象{} tmpObj
  2. 执行构造函数,其中对 this 的操作就是对 tmpObj 的操作
  3. 函数执行完毕返回 tmpObj
  4. tmpObj 赋值给 new 的新对象

题目来自饥人谷

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

No branches or pull requests

1 participant