填充函数

function a100(...rest) {
    return rest.length ? rest[0] + 100 : 100
}

function a200(...rest) {
    return rest.length ? rest[0] + 200 : 200
}

function add(...rest) {
    return rest[0]
}
console.log(a100(add(a200()))) // 300
console.log(a200(add(a100()))) // 300

 

posted @ 2020-10-08 20:37  671_MrSix  阅读(139)  评论(0编辑  收藏  举报