function Fn(){ this.test1 = function(){ console.log('test1()'); }; } Fn.prototype.test2 = function(){ console.log('test2()'); }; var fn = new Fn(); fn.test1();//"test1()" fn.test2();//"test2()" console.log(fn.toString());//"[object Object]" fn.test3();//报错,"undefined is not a function"