1.每一次函数调用都返回当前的实例对象
function animal(name) {
this.name = name;
this.sayHi = function() {
console.log('Hi');
return this;
}
this.sayHello = function() {
console.log('sayHello ');
return this;
}
}
var dog = new animal('dog');
dog.sayHi().sayHello();