Find: Type Mismatch
Find the Mistake Easy
Question
This code has a type error. Find and explain the mistake:
Code
let count: number = 10;
count = "twenty";
Hint
Check the type annotation on line 1 vs the value assigned on line 2.
Explanation
The mistake is on line 2: count is declared as number, but it is being assigned a string "twenty". TypeScript will error: Type 'string' is not assignable to type 'number'. Fix: either change the type annotation to string or assign a number value.
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.