How to use arrow function that return string in TypeScript

1 Answer

0 votes
const PrintName =  (name: string): string => {
  return name;
}


console.log(PrintName("R2D2"));            


     
     
/*
run:
     
"R2D2" 
     
*/

 



answered Oct 29, 2021 by avibootz
...