gpt4 book ai didi

javascript - 从 setTimeout() 返回一个值

转载 作者:太空狗 更新时间:2023-10-29 17:43:35 25 4
gpt4 key购买 nike

<分区>

我想返回状态并将其值存储在变量 s 中。请提供一些帮助,我将不胜感激。

这是我的代码:

let s = setTimeout( ()=>{
this.matchService.getMatches().subscribe(ms => {
this.matches = ms;
let match = this.matches.find(match => match.id == id);
let status = match.status;
if(status == 'closed' || status == 'live') {
this.status.name = status;
}
return status;
});
},9000);
}

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com