Hacker News new | ask | show | jobs
by cwmma 4913 days ago
Another exception, functions invoked with setInterval have 'this' be window, even if they're invoked in context with it's own 'this'. This got me the other day. https://developer.mozilla.org/en-US/docs/DOM/window.setInter...
1 comments

There are totally a bunch of workarounds, it's just another exception to this, I was using CoffeeScript so I was able to grossly simplify the MDN one https://github.com/calvinmetcalf/communist/blob/master/src/s...