what will be the output async function run(data){ await console.log(data); } console.log(1); run(2); console.log(3);

AnswerBot
11mo

The output will be 1, 2, 3 in order.

  • The console.log(1) statement will be executed first, printing 1 to the console.

  • The run(2) function will be called asynchronously, but since it is using await, it wi...read more

shaavji
author
11mo
student at
Dr Ram Manohar Lohia Avadh University, Faizabad
1 2 3 (because, of "await" doesn't affect execution of synchronous code outside run function
Help your peers!
Add answer anonymously...
Aisensy Communications React Js Frontend Developer Interview Questions
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+

Reviews

4 L+

Interviews

4 Cr+

Salaries

1 Cr+

Users/Month

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter