大话西游666
var Ob = { arr: [], add(fn, val){ this.arr.push({ fn, val }) return this }, fire(){ var arr = this.arr var obj = arr.splice(0, 1)[0] || {} obj.fn && this.timeout(obj.val, obj.fn) }, timeout(val, cb){ setTimeout(x => { cb() this.fire() }, val * 1000) }}var a = function(){ console.log(1) }var b = function(){ console.log(2) }var c = function(){ console.log(3) }Ob.add(a, 1).add(b, 1.5).add(c, 0.8)Ob.fire()