Tuple Patterns
👨💼 Excellent! You've mastered tuple return patterns.
🦉 The
[value, error] or [value, success] pattern is common in TypeScript.
It's inspired by Go's error handling pattern.Benefits:
- Forces callers to handle both success and failure
- No need for try/catch in many cases
- Types are explicit about what can happen
You'll see this pattern used in many libraries and APIs.