Code QuizIntermediate

Generics with Union Types

Finding the too-narrow constraint on a generic union parameter.

Codetypescript
function wrap<T extends string>(value: T): T[] {
  return [value];
}

const r = wrap<string | number>(42);

What is the bug in this code?