let o = { i: 0, up(x){ x || this.i++ return this[x || "up"].bind(this) }, down(x){ x || this.i-- return this[x || "down"].bind(this) }, show(x){ console.log(this.i) return this[(x =x || "show")].bind(this) } }; o.up("up")("down")()()("up")()() o.i