-
Notifications
You must be signed in to change notification settings - Fork 638
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
做了一道题,回答了一下输出的内容 #159
Comments
第一题:2-4-1-1-2-3 |
设计到的知识点有:变量提升、函数提升(函数声明和函数表达式)、原型和原型链、构造函数、this指向问题 第一段代码
第二段代码
|
2,4,1,1,2,3 |
|
第二段最后一个结果输出1是因为实例化Foo的时候有了this指向所以输出1,第一段代码因为this上不存在getName会向原型链上查找执行Foo.prototype.getName = function(){ alert(3); }; |
1 similar comment
第二段最后一个结果输出1是因为实例化Foo的时候有了this指向所以输出1,第一段代码因为this上不存在getName会向原型链上查找执行Foo.prototype.getName = function(){ alert(3); }; |
做了一道题,回答了一下输出的内容
然后改动了一个地方,继续问我输出结果是什么
The text was updated successfully, but these errors were encountered: