Skip to content
webtype.org#224 join-tuple · par 4

No. 224 · Hard · template literal types

Join

Implement `Join<T, D>` so it concatenates a tuple of strings with the delimiter `D` between them. No delimiter before the first element or after the last.

Puzzle

join-tuple.ts
Stroke 1 of 4Not run yet

Replace ??? — your solution is checked against the cases below.

Checks

4
  • Join<['a', 'b', 'c'], '-'>
    'a-b-c'
  • Join<['solo'], '-'>
    'solo'
  • Join<[], '-'>
    ''
  • Join<['x', 'y'], ''>
    'xy'

How a check is judged Exact type equality, not assignability — an intersection is not the same as the flattened object.

How everyone did

Nobody is counting yet. Score distribution and the short game board arrive with accounts — until then your results stay on this device.

Archive