Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

generic interface typescript

interface GenericIdentityFn {
  <Type>(arg: Type): Type;
}
 
function identity<Type>(arg: Type): Type {
  return arg;
}
 
let myIdentity: GenericIdentityFn = identity;
Source by www.typescriptlang.org #
 
PREVIOUS NEXT
Tagged: #generic #interface #typescript
ADD COMMENT
Topic
Name
9+9 =