Skip to content

Instantly share code, notes, and snippets.

@xodhx4
Created April 2, 2020 11:29
Show Gist options
  • Save xodhx4/464f2dc6d9951c67576a9b92e666ccff to your computer and use it in GitHub Desktop.
Save xodhx4/464f2dc6d9951c67576a9b92e666ccff to your computer and use it in GitHub Desktop.
Markdium-JS 초보가 쓰는 async await 처음부터 이해하기
async function returnResult() { // Promise를 리턴
const result = await callApi();
return result + 10;
}
function returnResult() { // Promise를 리턴
return callApi()
.then(function(result) {
return result + 10
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment