Bu Sari’s masak() stops at await and leaves the hearth while the runners go to the market: guess the order it prints, then a real async function in the…
The key idea
await pauses the function, not the program
Try it in this playground
Step until masak() stops at await Watch masak() leave the stove and its await line marked as waiting.
See a guest served before the egg arrives 'tamu' is printed while masak() still waits: its caller does not stop with it.
Run it one by one, then both at once Compare the times: added up, or only the longer one.
The egg is here, yet it still waits Pick the egg 'already here': 'telur' still prints after 'tamu', because the rest of a function after await is always a microtask.