Advertisement
AyanUpadhaya

Asynchronous Programming and Call Back Function Example

Oct 21st, 2021
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. console.log("First Line");
  2.  
  3.  
  4. var async = function(func,time){
  5.     setTimeout(()=>{
  6.         console.log(func());
  7.     },time);
  8. }
  9.  
  10. function sayHello(){
  11.     return "Hello world javascript";
  12. }
  13.  
  14. async(sayHello,3000);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement