letarr=[]functionsendPost(text){returnnewPromise((resolve)=>{setTimeout(()=>{arr.push({text,time:newDate()})resolve(text)},1000)})}consttext1=['a1','a2','a3','a4']consttext2=['b1','b2','b3','b4']想要的结果如下,是一次性输出text1再每隔一秒顺序输出text2(时间格式我简略了,这不是重点),用promise的话怎么实现arr=[{text:"a1",time:11:44:51},{text:"a2",time:11:44:51},{text:"a3",time:11:44:51},{text:"a4",time:11:44:51},{text:"b1",time:11:44:52},{text:"b2",time:11:44:53},{text:"b3",time:11:44:54},{text:"b4",time:11:44:55}]
达令说
慕的地6264312
相关分类