Answers for "how to type arrow function typescript"

7

generic arrow function typescript

const foo = <T extends unknown>(x: T) => x;
Posted by: Guest on April-29-2020
2

arrow function in ts

// ES6: With arrow function  
var getResult = (username: string, points: number): string => {  
  return `${ username } scored ${ points } points!`;  
};

getResult('joyous jackal' , 100);
Posted by: Guest on October-12-2020

Code answers related to "TypeScript"

Browse Popular Code Answers by Language