SOURCE

function fun1(id) {
    return new Promise(function (resolve, reject) {
        id = id+1
        resolve(id);  
        console.log('fun1',id);
    })
}


function fun2(id) {

    return new Promise(function (resolve, reject) {
        fun1(id).then((id1)=>{
            id = id1 +id;
            resolve(id)
            console.log('fun2',id);
        })

        
    })
}
console 命令行工具 X clear

                    
>
console