TypeScript Type Definition Practice
MediumTypeScriptIntermediate
Overview
Practical code using TypeScript type definitions and interfaces.
Code PreviewTypeScript
interface User {
id: string;
name: string;
email: string;
age?: number;
}
type UserRole = "admin" | "user" | "guest";
const createUser = (name: string, role: UserRole): User => {
return {
id: crypto.randomUUID(),
name,
email: `${name}@example.com`,
};
};Statistics
Time Limit
1:10Created
January 20, 2026Challengers
1Completions
0Avg Accuracy
93.0%Avg WPM
40Ranking
| Rank | User | WPM | Accuracy |
|---|---|---|---|
Ssupermandesu | 40 | 93.0% |
Exercise Ranking
Top typers for this exercise
Total Participants
1
Period
All Time
Total Challenges (All Users)
2
Total Practice Time (All Users)
00:02:20
Total Keystrokes (All Users)
498
Period
Sort
| Rank | User | wpm | Accuracy | Started/Completed | Correct/Strokes | Total Time | Last Attempt |
|---|---|---|---|---|---|---|---|
Ssupermandesu | 40.00 | 93.00% | 2/0 | 463/498 | 00:02:20 | 1/20/2026, 10:35 PM |
Ranking of 1 users