我有一个函数save,它可以被多次调用,并对我们的服务器进行AJAX调用。当函数仍在保存时,我想在页面上显示一个指示器,该指示器将在所有保存请求完成后消失。我不能简单地使用Promise.all,因为在所有save请求完成之前,可能会有更多的请求。例如: console.log('adding promise' + index
在下面的脚本中,我有两个承诺。现在"secondPromise“先执行,然后执行"firstPromise”。因为在"secondPromise“中我设定的时间更少。) let result = 2 + 2; setTimeout(() => console.log("please show me first"), 2000);const secondPromise = new Promise(