60 seconds

TypeScript typing test

Real lines of TypeScript: interfaces, generics, union types and every colon and angle bracket that comes with them. The test above is already set to TypeScript.

What does the TypeScript typing test look like?

Each run shuffles real TypeScript one-liners together until there are at least 55 pieces to type. Three of them, exactly as they appear:

interface User {
  id: string;
  email: string;
  roles: Array<"admin" | "editor">;
}
export type Result<T, E = Error> =
  | { ok: true; value: T }
  | { ok: false; error: E };
export function isDefined<T>(v: T | null): v is T {
  return v != null;
}

Typed as tokens: interface User { id: string; email: and so on, one Space between each.

Type a piece, press Space, and move on. A piece only counts when every character is right, angle brackets included. The clock starts on your first key.

Which symbols slow TypeScript programmers down?

TypeScript spreads the work across a wide set of symbols. Colons lead, because every annotation needs one, followed by semicolons and braces from interfaces and object types, then angle brackets for generics. Here is how often each appears in the TypeScript test, and where it lives on a US keyboard:

SymbolNameShare of symbolsKey (US layout)Finger
:Colon15%Shift + ;Right little
;Semicolon12%;Right little
{Opening brace8%Shift + [Right little
}Closing brace8%Shift + ]Right little
=Equals7%=Right little
(Opening bracket6%Shift + 9Right ring
)Closing bracket6%Shift + 0Right little
>Greater than5%Shift + .Right ring
<Less than4%Shift + ,Right middle
"Double quote4%Shift + 'Right little

Angle brackets are Shift plus comma and Shift plus full stop, typed with the right middle and ring fingers. Generic types like Array<"admin" mix them with quotes and capitals in a few characters, which is where slips tend to happen.

How do I type TypeScript faster?

  • Make the colon-space automatic. id: string is Shift plus semicolon, then Space. It comes up in nearly every line.
  • Pair your brackets. Type < and >, { and } as pairs in practice so the closing one never surprises you.
  • Capitals with the opposite Shift. Type names like ReadonlyArray start with a capital. Use the Shift key on the opposite hand to the letter.
  • Watch the pipe. Union types use |, Shift plus backslash, a long reach for the right little finger.
  • Drill the slips. Click a missed key on your result for a drill built on it.

How is the TypeScript test scored?

Net words per minute counts correct characters, five to a word, and accuracy counts every key you press. You also see raw WPM, consistency, your slowest pieces and a heatmap of missed keys. Compare your TypeScript runs with each other rather than with your prose speed.

For plainer code, try the JavaScript typing test.

Code typing tests in other languages

All 6 languages
Advertisements

Questions people ask

What TypeScript code will I type?

Real one-line snippets: an interface with a union of string literals, an assertNever helper, a Result type, a DeepPartial mapped type, a const with as const satisfies, a type guard and a Map with generic parameters. They are shuffled into every run.

How is TypeScript different from the JavaScript test?

TypeScript lines carry more colons for type annotations, more angle brackets for generics, more square brackets and more capitals for type names. Colons and semicolons alone are nearly a quarter of the symbols, so expect it to feel slower than JavaScript.

Does it include indentation?

No. Each line is split on spaces and you type the pieces with a single space between them, so the test trains symbols and names rather than whitespace.

Does choosing TypeScript here change my settings?

No. This page opens the code test in TypeScript for this visit only. Your saved code language stays as it was until you choose another in the options above the test.

Keep going

Typing tests by length: 15 second typing test · 30 second test · 1 minute typing test · 2 minute test · 5 minute typing test · 10 minute test · custom text

In other languages: Spanish typing test · French typing test · German typing test · Portuguese typing test · Italian typing test · Test de mecanografía en español · Teste de digitação em português