function js(){
}
js.prototype.show1=function(){}
js.show2=function(){}
为什么 show1 方法这样 js.show1() 调用会报show1方法不存在的错误,而 js.show2( )却不报错,show1方法好像必须实例化调用 new js().show1();???
      4 回复
    
    
see
function MyClass(){}
MyClass.prototype.a = function(){}   // public method.
MyClass.b = function(){}   // static method.
call:
var obj = new MyClass();
obj.a(); 
MyClass.b();  // call static metho b
签名: 交流群244728015 《Node.js 服务器框架开发实战》 http://url.cn/Pn07N3