2 回答

慕碼人2483693
TA貢獻1860條經驗 獲得超9個贊
var AI = function () { this.timeout = null; this.cancel = function () { clearTimeout(this.timeout); return this; } this.talk = function () { this.timeout = setTimeout(() => console.log('talk')); return this } }var ai = new AI() ai.talk().cancel()
添加回答
舉報
0/150
提交
取消