Break Any Vs Unknown
👨💼 You understand the difference between
any and unknown!You learned:
- 🚨
anydisables type checking—dangerous! - 🛡️
unknownrequires narrowing—safe! - ✅ Best practice: Use
unknownfor external data
🦉 When you encounter
any in code, ask:- Can this be
unknowninstead? - What type should this actually be?
- Is there a more specific type available?
Every
any is a potential bug waiting to happen. Prefer unknown and narrow
it properly.🎉 Congratulations! You've completed the Type Safety workshop. You can now
design types that make illegal states unrepresentable!
Test Your Knowledge
Retrieval practice helps solidify learning by actively recalling information. Use this prompt with your AI assistant to quiz yourself on what you've learned.
Please quiz me on exercise 5 using the epicshop MCP server. Call the get_quiz_instructions tool with exerciseNumber "5" to get the quiz instructions, then quiz me one question at a time.