IT討論區(132) 工程師應該放心大膽地創造技術負債

1001 回覆
3 Like 3 Dislike
2021-08-25 21:52:33
2021-08-25 21:57:15
Yes
2021-08-25 21:59:04
2021-08-25 22:01:05
2021-08-25 22:03:59
2021-08-25 22:06:22
2021-08-25 22:34:18

2021-08-25 22:40:46
2021-08-25 22:45:57
2021-08-25 23:03:23
用得await, function前面一定要async
var asyncFn1=()=>{
    return new Promise(r=>
        setTimeout(()=>r('time1'),2000)
    )
}
var asyncFn2=()=>{
    return new Promise(r=>
        setTimeout(()=>r('time2'),2000)
    )
}
async function oneByOne(){
    const res1= await asyncFn1();
    console.log('got res1 ',res1);
    const res2= await asyncFn2();
    console.log('got res2 ',res2);
    const twoResult= res1+','+res2;
    console.log('twoResult ',twoResult);
}
oneByOne();

唔想function即時比result你,result困住係個function入面,先用promise包住佢。
2021-08-25 23:08:40
2021-08-26 00:20:05
2021-08-26 00:20:50
2021-08-26 07:31:36
算 IT包好多野
2021-08-26 08:49:18
2021-08-26 09:43:53
2021-08-26 10:10:08
2021-08-26 10:14:44
IT support
2021-08-26 13:07:47
其實puppet 同ansible 有咩分別?有冇高手解答下
2021-08-26 13:48:04
2021-08-26 15:01:19
async await來講
ts真係好過js好多
2021-08-26 16:42:00
async await唔係一pair嘅話ts會直接屌你
吹水台自選台熱 門最 新手機台時事台政事台World體育台娛樂台動漫台Apps台遊戲台影視台講故台健康台感情台家庭台潮流台美容台上班台財經台房屋台飲食台旅遊台學術台校園台汽車台音樂台創意台硬件台電器台攝影台玩具台寵物台軟件台活動台電訊台直播台站務台黑 洞