Code QuizIntermediate

Inferring the Type Parameter

Find why the explicit type argument clashes with the inferred one.

Codetypescript
function first<T>(arr: T[]): T {
  return arr[0];
}

const nums = [1, 2, 3];
const result = first<string>(nums);

What is the bug when calling this generic function?