Q:

typescript arrow function

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

sum(10, 20); //returns 30
4
//prototype 
const/let <FunctionName> = (params: type) :<ReturnType> =>{
  ....
};

const PrintName =  (name: string): string => {
  return console.log("my name is " , name) ;
}
1

New to Communities?

Join the community