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!
Add answer anonymously...
>
Aisensy Communications React Js Frontend Developer Interview Questions
Stay ahead in your career. Get AmbitionBox app


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
AmbitionBox Awards
Get AmbitionBox app

