const foo = <T extends unknown>(x: T) => x;
//prototype
const/let <FunctionName> = (params: type) :<ReturnType> =>{
....
};
const PrintName = (name: string): string => {
return console.log("my name is " , name) ;
}
// ES6: With arrow function
var getResult = (username: string, points: number): string => {
return `${ username } scored ${ points } points!`;
};
getResult('joyous jackal' , 100);
const addNumbers =(num1:number,num2:number)=>{
console.log(num1+num2)
}
addNumbers(2,4);