Created
November 17, 2021 13:12
-
-
Save sibelius/49729fb6c5b70eafddb7212e525acb46 to your computer and use it in GitHub Desktop.
early return to check required condition
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const fn = async () => { | |
if (!requiredCondition) { | |
return; | |
} | |
if (!anotherRequiredCondition) { | |
return | |
} | |
await mainCode(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment