I am trying to learn TypeScript using Barasat Ali Syed's Deep Dive.
I came across below code in Arrow Functions and inheritance. Please help me understand what is the significance of second :string in this line "(b:string) : string"
class Adder {
constructor(public a: number) {}
// This function is now safe to pass around
add = (b: string): string => {
return this.a + b;
}
}
return number + stringthat is of a typestring.