Wheemangga

Call Stack Micro & Macro task.

Mar 5th, 2023
600
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.   function pertama() {
  3.     console.log("pertama");
  4.   }
  5.   function kedua() {
  6.     console.log("kedua");
  7.   }
  8.   function ketiga() {
  9.     console.log("ketiga");
  10.    
  11.     setTimeout(pertama, 0);
  12.    
  13.     new Promise((resolve, reject) => {
  14.       resolve("Promise OK");
  15.     }).then((data) => console.log(data));
  16.    
  17.     kedua();
  18.   }
  19.   ketiga();
  20.  
Advertisement
Add Comment
Please, Sign In to add comment