how to type the return of a function typescript code example
Example 1: function with return type in angular
greet() : number {
return "Hello, " + this.greeting;
}
Example 2: typescript annotate return type
function add(x: number, y: number): number {
return x + y;
}