Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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...



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...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: