I created MyObject in javascript and I need to return its method like this
var m = new MyObject();
document.onclick = m.myMethod;
But the problem is, all the m instance variables appear to be undefined, I can't access them (even though they are defined on m) and operations on them result in NaN. How do I do this properly, so instance variables stay set when method is executed?
newkeyword?var m = new MyObject();?