tomayac’s avatartomayac’s Twitter Archive—№ 17,960

  1. It's an admittedly very weird corner case, but should this work? js const promiseArray = [Promise.resolve(3), Promise.resolve(1), Promise.resolve(2)]; promiseArray.sort(async (a, b) => await b - await a); Spoiler: it doesn't work, but should it? tc39.es/ecma262/multipage/indexed-collections.html#sec-array.prototype.sort
    1. …in reply to @tomayac
      Thanks for the replies, I know how to make it work, just wondering if it could/should work as in the tweet above. Someone actually has built an async version of the Array functions: github.com/Bin-Huang/prray#prrayprototypesortasyncfunc.