Questions about the order of code execution under chrome version 67 and node8.9.4

problem description

questions about the sequence of code execution under chrome version 67 and node8.9.4

< hr >

the code is as follows:

/ / existing tasks An and B.
/ / for task A, whether synchronous or asynchronous,
/ / wants AB serial processing, that is, An executes B

.

const log = console.log;
const f = () = > console.log ("A");

(async () = > f ()) ();
log ("B");

/ / execution result
/ / chrome version 67 A = > B
/ / node8.9.4 B = > A

< hr >

question, why is the execution order different?

Jul.14,2022
Menu