Code QuizIntermediate

Constraining with extends

Find why accessing .length on an unconstrained type fails.

Codetypescript
function getLength<T>(item: T): number {
  return item.length;
}

getLength([1, 2, 3]);

What is the bug in this generic function?