链式调用


var Run = function (arg) {
  return new Run.prototype.init(arg)
}
Run.prototype = {
  init: function () {
    this.name = 'xw'
    return this
  },
  save: function () {
    return this
  }
}
Run.prototype.init.prototype = Run.prototype

猜你喜欢

转载自www.cnblogs.com/daysme/p/11405226.html