course
TypeScript Development
Learn to develop maintainable JavaScript applications with TypeScript
Description
Learn to develop maintainable JavaScript applications with TypeScript.
We develop ever larger JavaScript applications today. Unfortunately this language is not well-suited for this purpose. That's why we use TypeScript. TypeScript helps by expanding the JavaScript syntax with a type system. As a result, you can detect errors earlier and enjoy better tooling support. This all leads to higher efficiency and code quality.
In this training you start by learning the basics of TypeScript, including primitive types and functions. Then you'll be introduced to more advanced concepts, like literal types, interfaces, and generics. In the end you will master the principle of structural typing with mapped types and conditional types.
There is plenty of time to practice, as you will implement these concepts in an application you build from the ground up.
Did you know that:
false === true
is a compile error?- interfaces don't exist in JavaScript?
public
andprivate
are a myth?- a class can
implement
another class? - an interface can
extend
a class? - defining a class does two things?
- TypeScript is not a typesafe language?
- there exists a type called
never
? - TypeScript supports exhaustiveness checking?
- you can write a for loop in a type?
- you can define a type using a ternary expression?
- you can define a type using a template literal?
Prior Knowledge
Basic knowledge of JavaScript.
Subjects
- Introduction
- Getting started
- Types
- Variable declaration
- Functions
- Interfaces
- Classes
- Generics
- Structuring code
- JavaScript interop
- Compiler
- Advanced types
- Advanced use cases
- Async/await
- Mapped types
- Template literal types
- Decorators - if time permits
- JSX Support - if time permits
Introduction
In this chapter, you will learn the context in which to place TypeScript. Goals:
- Learn how TypeScript relates to JavaScript.
- Know what "type-safety" means and how it relates to TypeScript
- Learn to use TypeScript in a regular JavaScript file.
Getting started
In this chapter, you will learn how to create a plain TypeScript application. Goals:
- Learn the basics of a NodeJS project.
- Learn the basics of
tsc
(typescript compiler) - Know how to run an application in nodejs
- Know how to debug a TypeScript application.
- Learn some basic compiler options.
Types
In this chapter, you will learn how to declare and use primitive types in a TypeScript file. Goals:
- Know the primitive types.
- Understand what
any
does and why not to use it. - Learn to use
--noImplicitAny
- Learn to use
--strictNullCheck
- Know the difference between
null
andundefined
. - Learn what literal types are.
Variable declaration
In this chapter, you will learn the different ways to declare a variable in TypeScript. Goals:
- Know the difference between blocked scope and function scope.
- Learn to use
const
andlet
.
Functions
In this chapter, you will learn the different ways to define and use functions and some related ES features. Goals:
- Learn to use functions in TypeScript
- Learn to use some recent additions to JavaScript, like spread operator and destructuring.
- Understand what
this
points to inside a function. - Know the difference between function expressions and arrow functions
Interfaces
This chapter will dive into the heart of the type system: define the shape of objects with interfaces. Goals:
- Learn what a 'shape' is and how to name one.
- Learn the different ways to modify properties.
- Know how to use index accessors.
- Learn what a method shape is.
- Learn to use overloading in interfaces.
Classes
In this chapter, you will learn all there is to know about classes in TypeScript. Goals:
- Learn to use classes.
- Know the difference between private, public, protected, and ES private.
- Learn how to use prototypal inheritance.
- Learn how to use properties and when (not) to use them.
- Know to associate types with classes and class instances.
- Learn to love
--strictPropertyInitialization
. - Know how to use method overloading.
- Learn what
this
points to inside a class body.
Generics
This chapter dives into generic type argument. Goals:
- Learn what a generic type argument is and why they are usefull.
- Learn to use type constraints.
- Learn to prevent a death by a thousand overloads using spreading parameter types.
Structuring code
In this chapter, you will learn how to scale your TypeScript application across multiple files.
- Learn the two ways to structure code in TypeScript
- Learn what a "module" is.
- Know the different output modes for modules.
- Know how to consolidate multiple modules into one.
- Know how to avoid some pitfalls with ES modules.
JavaScript interop
In this chapter, you will learn how to use JavaScript code from TypeScript. Goals:
- Learn how to import and use JS code.
- Know what a declaration file is and how to use them.
- Understand how type-resolution works.
Compiler
This chapter showcases useful compiler options, and introduces you to project references. Goals:
- Know how to include and exclude TypeScript files.
- Know all the essential options and strictness options.
- Understand when to use project references.
- Learn to split a program into multiple projects with project references.
Advanced types
This chapter showcases advanced type concepts. Goal:
- Understand the concept of "type compatibility"
- Learn to combine types with unions and intersections.
- Learn to name types with an alias
- Know the concept of a "type query".
- Learn to love the
unknown
type. - Learn to perform type assertions and type guards
Advanced use cases
In this chapter, you will combine some advanced concepts of the previous chapter into use cases.
- Learn to create and use a discriminated union.
- Learn what the
never
type is and why it s usefull - Learn to create an exhaustive check
Async/await
In this chapter, you will learn the concept of "Promises" in JavaScript and what TypeScript adds to this. Goals:
- Know the concept of "delayed work."
- Learn to work with promises
- Understand what
async
andawait
do to your program. - Learn to use promises in the wild.
Mapped types
In this chapter, you will learn to define for-loops and if-statements inside TypeScripts type system. Goals:
- Know what a "lookup type" is.
- Learn how to create a simple mapped type.
- Know the build-in mapped types.
- Know what a conditional type is.
- Learn where conditional types can be helpful.
Template literal types
We end with a grand finally: defining and using template literals inside the type system. Goals:
- Know what a template literal type is
- Understand how to create a 'stringly typed' yet type-safe API.
- Know some basic string manipulation in the type system.
Decorators - if time permits
JSX Support - if time permits
Schedule
Start date | Duration | Location | |
---|---|---|---|
November 25, 2024November 26, 2024November 27, 2024 | 3 days | Utrecht / Remote This is a hybrid training and can be followed remotely. More information Utrecht / Remote This is a hybrid training and can be followed remotely. More information Utrecht / Remote This is a hybrid training and can be followed remotely. More information | Sign up |
January 6, 2025January 7, 2025January 8, 2025 | 3 days | Veenendaal / Remote This is a hybrid training and can be followed remotely. More information Veenendaal / Remote This is a hybrid training and can be followed remotely. More information Veenendaal / Remote This is a hybrid training and can be followed remotely. More information | Sign up |
March 3, 2025March 4, 2025March 5, 2025 | 3 days | Utrecht / Remote This is a hybrid training and can be followed remotely. More information Utrecht / Remote This is a hybrid training and can be followed remotely. More information Utrecht / Remote This is a hybrid training and can be followed remotely. More information | Sign up |
April 7, 2025April 8, 2025April 9, 2025 | 3 days | Veenendaal / Remote This is a hybrid training and can be followed remotely. More information Veenendaal / Remote This is a hybrid training and can be followed remotely. More information Veenendaal / Remote This is a hybrid training and can be followed remotely. More information | Sign up |
All courses can also be conducted within your organization as customized or incompany training.
Our training advisors are happy to help you provide personal advice or find Incompany training within your organization.
Trainers
Prior knowledge courses
"The instructor was clearly very experienced and had a lot of knowledge about the subject."Mika
-
Hoge waardering
-
Praktijkgerichte trainingen
-
Gecertificeerde trainers
-
Eigen docenten