Find: Incorrect Enum
Find the Mistake Easy
Question
This code has a type error. Find the mistake:
Code
enum Color { Red, Green, Blue }
const c: Color = Color.Purple;
Hint
Check if the enum member being accessed actually exists.
Explanation
The enum Color has members Red, Green, and Blue — there is no Purple member. TypeScript errors: Property 'Purple' does not exist on type 'typeof Color'. Fix: use a valid member like Color.Red or add Purple to the enum definition.
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.