考虑以下作业:
const promise1 = (async () => { await someAsyncFunction(); })(); const promise2 = new Promise(async resolve => { await someAsyncFunction(); resolve(); });
这两个 Promise 之间有什么有意义的区别(除了冗长之外)吗?
它们基本相同,
IIFE