我想我的代碼是這樣的:添加方法的方法
select("*").where("you='me'").and("me='him'").and("game='nes'");
我只有這個:
function select(selector){
this.where = function(where){
//Do something with where and select.
//Add the method AND <---
}
}
我不知道如何來添加方法的方法,其中添加。
什麼好像你正在努力實現在調用'方法chaining',在這裏讀了一下:http://kwilson.me.uk/blog/simple-javascript-method-chaining/ –