Skip to content

Instantly share code, notes, and snippets.

@Gaafar
Last active June 24, 2023 03:46
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Gaafar/e33b6f757793d439070b541437e69bd6 to your computer and use it in GitHub Desktop.
Save Gaafar/e33b6f757793d439070b541437e69bd6 to your computer and use it in GitHub Desktop.
const makeRequest = async () => {
const data = await getJSON()
if (data.needsAnotherRequest) {
const moreData = await makeAnotherRequest(data)
console.log(moreData)
return moreData
} else {
console.log(data)
return data
}
}
@jens-ox
Copy link

jens-ox commented Sep 1, 2017

Is it correct that the semicolon in line 4 is not needed?

@tjcchen
Copy link

tjcchen commented Dec 17, 2020

is semicolon still needed at the end of each line of code? thanks a lot.

@tjcchen
Copy link

tjcchen commented Dec 17, 2020

By the way, your blog is super awesome, @Gaafar!

@Gaafar
Copy link
Author

Gaafar commented Dec 17, 2020

@tjcchen Thanks a lot for your comment. Semicolons are not needed

@tjcchen
Copy link

tjcchen commented Dec 17, 2020

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment