Skip to content
RED SAG Skills
mediumStudy question · answer published in TypeScript interview questions, so no pointsjavascripttypescriptgenerics

Constraining a generic

Which call is a compile-time error?

function longest<T extends { length: number }>(a: T, b: T) {
  return a.length >= b.length ? a : b
}
Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions