How to pass a function to setTimeOut function in TypeScript

1 Answer

0 votes
function mul(a: number, b: number) {
    console.log(a * b) 
}
 
setTimeout(function() {
    mul(3, 4);
}, 2000); 
   
  
  
  
   
/*
run:
         
12
       
*/

 



answered Dec 18, 2021 by avibootz
...