前端学习笔记202310学习笔记第一百零玖天-vue3-链式调用&对象属性与遍历&this指向&caller_callee之4

console.log("geyao")
var sched={
    wakeup:function(){
        console.log('Running')
        return this
    },
    morning:function(){
        console.log('Going shopping')
        return this
    },
    noon:function(){
        console.log('Having a rest')
        return this
    },
    afternoon:function(){
        console.log('studying')
        return this
    },
    evening:function(){
        console.log('Walking')
        return this
    },
    night:function(){
        console.log('Sleeping')
        return this
    },
}

sched.wakeup().morning().noon().afternoon().evening().night()

运行结果

 

posted @ 2023-10-31 09:21  前端导师歌谣  阅读(6)  评论(0编辑  收藏  举报  来源