What you do today can improve all your tomorrows.
Bear in mind: S = Single Responsibility Principle
O = Opened Closed Principle
L = Liskov Substitution Principle
I = Interface Segregation Principle
D = Dependency Inversion Principle
摘要:
function myTest(){ this.context=this.constructor;}myTest(); // must be invoke, if not, alert(context) bug show: context is not defined.alert(context); //context is windowvar o =new myTest();alert(context); //context is windowalert(o.context); // context is myTest object 阅读全文