JS实现链式调用 a().b().c()

function a() {
    this.b = function () {
        console.log('111')
        return this
    }
    this.c = function () {
        console.log('111')
        return this
    }
    return this
}

a().b().c()
posted @ 2019-11-13 18:50  Nayek  阅读(723)  评论(0编辑  收藏  举报