TypeScript Playground
Experiment with types and see compiler feedback instantly.
Free browser tool.
Explore toolLesson 3 of 3 · 8 min
Annotate inputs and outputs: function add(a: number, b: number): number { return a + b }.
The compiler then warns whenever a caller passes the wrong kind of value.
Write a typed function that doubles a number and returns a number.
Optional resources
No purchase or partner signup is required to complete this course or earn quiz points.
These are official product links, not active affiliate links. Learnly does not currently earn a commission from them.
Experiment with types and see compiler feedback instantly.
Free browser tool.
Explore tool