Find: Wrong Tuple Type
Find the Mistake Medium
Question
This code has a type error. Find the mistake:
Code
const pair: [string, number] = [42, "hello"];
Hint
Check the order of types in the tuple vs the order of values.
Explanation
The tuple type [string, number] expects a string first and a number second, but the values are reversed: 42 (number) is first and "hello" (string) is second. Fix: swap the values to ["hello", 42] or change the tuple type to [number, string].
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.