JavaScript275 Documents

Promise Handling

Await promises, return them, or explicitly detach them with void when intentional.

Correct

await loadAsync()
return loadAsync()
void loadAsync()

Incorrect

loadAsync()

Fix

Await the promise, return it, or prefix an intentional detached promise with void.