Learn TypeScript: Functions
Type your functions: see what goes wrong in plain JavaScript, then add parameter annotations, optional and default parameters, inferred and explicit return types, void, and JSDoc comments, ending with a typed recipe scaler.
- Intermediate level
- 1 module
- 10 lessons
- 39 tasks and questions
Syllabus
01FunctionsSee why functions need types, annotate parameters, make them optional or give them defaults, let TypeScript infer return types or declare them yourself, use void for functions that return nothing, and document functions with JSDoc.10 lessons