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

JavaScript的this的用法 | Davis #6

Open
lvzero535 opened this issue Nov 25, 2018 · 0 comments
Open

JavaScript的this的用法 | Davis #6

lvzero535 opened this issue Nov 25, 2018 · 0 comments

Comments

@lvzero535
Copy link
Owner

https://lvdongfeng.vip/2018/06/04/JavaScript%E7%9A%84this%E7%9A%84%E7%94%A8%E6%B3%95/

JavaScript的this的用法函数调用 直接调用函数时,不管调用位置如何(函数内或函数外),this都指向全局对象window。 注意:在严格模式下,这种用法是不允许,this返回值是undefined 12345function foo(x){ this.x =x;}foo(2);console.log(x)//2 对象调用 当函数作为对象的方法调用时,函数内的

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

No branches or pull requests

1 participant