Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

generic function typescript

const valueWrapper = <T>(value: T): T[] => {
  return [value];
};

console.log(valueWrapper<number>(10));
Source by www.typescriptlang.org #
 
PREVIOUS NEXT
Tagged: #generic #function #typescript
ADD COMMENT
Topic
Name
6+9 =