I need to access this
from my setInterval
handler
prefs: null,
startup : function()
{
// init prefs
...
This would be the cleanest solution, since most of the time you actually want to switch the this context for your consecutive method calls:
Also it's easier to grasp the concept of.
// store scope reference for our delegating method
var that = this;
setInterval(function() {
// this would be changed here because of method scope,
// but we still have a reference to that
OURMETHODNAME.call(that);
}, 200);