Comment

Comment by statictype

I used to always run into trouble when trying to use 'this' inside a closure defined within an object's method.

Now, I just put

    var that = this;
at the top of very method and use 'that' everywhere in the function.
parent statictype 15 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton