Join Two Tuples, Position by Position

Write the code, see it run, pass the checks.

The problem

  • easy
  • Code

Export a type Concat<A, B> that joins two tuple types into one, A's positions first. Then write concat(a, b): return a new array with a's items followed by b's, leaving both unchanged. Type it so the result is the exact tuple, for example [string, number, boolean] for concat(['a', 1], [true]), and reading past its end is a type error.

Your code must pass

  • Joins the items in order
  • Returns a new array, leaving both unchanged
  • Has no type errors
  • Concat joins tuple types in order
  • concat keeps each position's type