MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/javascript/comments/192tn4/common_javascript_gotchas/c8kg25e/?context=3
r/javascript • u/stevekwan • Feb 23 '13
50 comments sorted by
View all comments
Show parent comments
0
This. Definitely this.
2 u/rabidcow Feb 23 '13 Sure, you could use this:(function(){ this.foo = 'foo'; })(); 2 u/mirion Feb 23 '13 Sigh. I should know better than to use the word 'this' in a javascript thread. 2 u/rq60 Feb 23 '13 Use 'that' next time.
2
Sure, you could use this:
this
(function(){ this.foo = 'foo'; })();
2 u/mirion Feb 23 '13 Sigh. I should know better than to use the word 'this' in a javascript thread. 2 u/rq60 Feb 23 '13 Use 'that' next time.
Sigh. I should know better than to use the word 'this' in a javascript thread.
2 u/rq60 Feb 23 '13 Use 'that' next time.
Use 'that' next time.
0
u/mirion Feb 23 '13
This. Definitely this.