Message from JavaScript discussions

April 2019

— Refer to javascript.info and Mozilla

— 

async function foo() {
console.log(3);
await something();
console.log(4);
}

console.log(1);
foo().then(function () {
console.log(5);
});
console.log(2);

— So the only difference would be the content after .then

— Notice the 2

— I heard you don't need to use .then with async and await

— It's drastically different

— I saw it

— Not really, byt it's important to know about it

— How would you form the same function without .then

— ??

— Await

— But you used await once there