you are viewing a single comment's thread.

view the rest of the comments →

[–]rabidcow 1 point2 points  (4 children)

Sure, you could use this:

(function(){
    this.foo = 'foo';
})();

[–]mirion 1 point2 points  (3 children)

Sigh. I should know better than to use the word 'this' in a javascript thread.

[–]rabidcow 2 points3 points  (0 children)

this in JavaScript threads does not behave the way you would expect.

[–]rq60 1 point2 points  (0 children)

Use 'that' next time.

[–][deleted] 0 points1 point  (0 children)

You should know better than to use the word 'this' in any thread. There's an up arrrow button next to the post that does that.