I want to use the value of a promise only if it’s already resolved, otherwise I want to use a placeholder (think content generation on the server side or SW, optimizing for TTFB).
Since promises don’t have `isResolved` or something similar, `Promise.race` comes in handy!
ALT const value = await Promise.race([otherPromise, Promise.resolve("Placeholder")]); `value` will take on the value* of `other Promise` only if `otherPromise` is already resolved. Otherwise it will be "Placeholder". Why? `Promise.race()` is spec’d to return the promise that resolves first. If there are multiple candidates, it takes the first one in the Array.