All academies
All challenges

Concatenate Tuples with Variadic Types

hardadvanced-types200 XP

Problem

Write concatTuples(a, b) that concatenates two tuples while preserving their exact element types in order: concatenating [number, string] with [boolean] must produce a value typed [number, string, boolean], not (number | string | boolean)[]. Use variadic tuple types — generic parameters spread into the return type with the [...A, ...B] syntax.

Expected output

[1,"two",true]
3
admin

Hints

Stuck? Reveal hints one at a time.

Solution

Try solving it yourself first — revealing is always available.

Press Run in the editor — your console output is checked automatically.
No errors
Loading...

Console output appears here. Press Run or just type — the code compiles automatically.