链式编程
转载function Student(id,name){
this.id = id;
this.name = name;
this.eat = function(food){
console.log("吃"+food);
return this;
},
this.sleep = function(){
console.log("睡");
return this;
}
}
var stu =new Student(1001,"张三");
stu.eat("").sleep().eat("").sleep().eat("").sleep().eat("").sleep();
//链式编程 jqerry同理
本文章为转载内容,我们尊重原作者对文章享有的著作权。如有内容错误或侵权问题,欢迎原作者联系我们进行内容更正或删除文章。
上一篇:js基本语法

提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
proxy实现链式编程
js实现链式编程
javascript 开发语言 ecmascript proxy 数组