How to use arrow function that return number in TypeScript

1 Answer

0 votes
let sum = (x: number, y: number): number => {
    return x + y;
}

console.log(sum(9, 12));            


     
     
/*
run:
     
21
     
*/

 



answered Oct 29, 2021 by avibootz
...