Lesson 10 of 56
TypescriptGeneric Constraints
25 minutes
Course progress18%
Constraining Generics with extends
interface Lengthwise { length: number; }
function logLength<T extends Lengthwise>(arg: T): void {
console.(arg.);
}
([, , ]);
();