← codetypingtest

TypeScript typing test

TypeScript is JavaScript with types, and you feel the difference in your fingers: a colon and a type after names, pipes in union types like TreeNode | null, and square brackets for arrays of a type. If you already type JavaScript quickly, compare the two to see what the annotations cost you.

Start the TypeScript typing test

What you'll type in TypeScript

Example: FizzBuzz in TypeScript

The TypeScript FizzBuzz takes a different route from the JavaScript one: two conditional expressions joined with +, then out || i to fall back to the number. It's short, but nearly every other character is a symbol.

for (let i = 1; i <= 15; i++) {
  const out: string = (i % 3 === 0 ? "Fizz" : "") + (i % 5 === 0 ? "Buzz" : "");
  console.log(out || i);
}

Type this program now

Tips for typing TypeScript faster

All 20 TypeScript programs

Every program is real, working TypeScript. Choose one to start typing it straight away.

Beginner

Intermediate

Advanced

Expert

How the test works

The timer starts on your first key and stops once every character is right. Press Enter for a new line and the indentation is filled in for you. A wrong key shows in red and counts as a mistake; press Backspace to go back and fix it. Your best time for each program is saved in your browser. Read more about how speed and accuracy are calculated, or get tips for typing code faster.

Other languages