What will be the output of the following code? async function run(data){ await console.log(data); } console.log(1); run(2); console.log(3);

AnswerBot
1y

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
1y
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!
Select
Add answer anonymously...
Aisensy Communications React Js Frontend Developer Interview Questions
Stay ahead in your career. Get AmbitionBox app
play-icon
play-icon
qr-code
Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+

Reviews

10L+

Interviews

4 Cr+

Salaries

1.5 Cr+

Users

Contribute to help millions

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

Follow Us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter
Profile Image
Hello, Guest
AmbitionBox Employee Choice Awards 2025
Winners announced!
awards-icon
Contribute to help millions!
Write a review
Write a review
Share interview
Share interview
Contribute salary
Contribute salary
Add office photos
Add office photos
Add office benefits
Add office benefits