TS1274

'in' modifier can only appear on a type parameter of a class, interface or type alias.

Broken Code ❌

function getArrayElement<in out T>(array: T[], index: number): T {
  return array[index];
}

Solution:

Remove the in and out modifiers from the function type parameter.

Fixed Code ✔️

function getArrayElement<T>(array: T[], index: number): T {
  return array[index];
}