generic arrow function typescript
const foo = <T extends unknown>(x: T) => x;
generic arrow function typescript
const foo = <T extends unknown>(x: T) => x;
arrow function in typescript
//prototype
const/let <FunctionName> = (params: type) :<ReturnType> =>{
....
};
const PrintName = (name: string): string => {
return console.log("my name is " , name) ;
}
typescript arrow function
let sum = (x: number, y: number): number => {
return x + y;
}
sum(10, 20); //returns 30
arrow function in ts
// ES6: With arrow function
var getResult = (username: string, points: number): string => {
return `${ username } scored ${ points } points!`;
};
getResult('joyous jackal' , 100);
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us