Skip to content

Tag: async-await

Why function is executed although await is used?

I have used await keyword in the main function to wait for the completion of async function call to poll() and yet the function call to my_plot is made before the completion of the poll() function. Code output: Expected: Answer Don’t use setTimeout directly from within an async function. Instead, use a …