TypeScript Fundamentals
Published by O'Reilly Media, Inc.
Build and maintain large web applications
TypeScript is an open source superset of JavaScript that you can use anywhere you can use JavaScript. It includes static types and helps you build applications that are easier to maintain and contain fewer bugs.
Join expert Brice Wilson to learn how to install TypeScript, run the compiler, and use all of the basic features of the language. Along the way, you’ll explore the relationship between JavaScript and TypeScript, the benefits of static typing in client-side applications, the syntax for creating and using generics, and more.
What you’ll learn and how you can apply it
By the end of this live online course, you’ll understand:
- The relationship between JavaScript and TypeScript
- The benefits of using TypeScript over JavaScript
- What a structural type system is and how it applies to TypeScript
- The benefits of using generics in your TypeScript applications
And you’ll be able to:
- Install and run the TypeScript compiler
- Use a tsconfig.json file to configure a TypeScript project
- Apply type annotations to variables and functions
- Create your own types with interfaces and classes
- Use generics to create code that’s more reusable
This live event is for you because...
- You’re a web developer curious about TypeScript.
- You’re working on medium to large web applications and want more maintainable code.
- You want to create browser and Node.js applications with fewer bugs.
- You’ve used other strongly typed languages and want to get started in web development.
Prerequisites
- Basic familiarity with JavaScript
- A computer with the text editor of your choice (Visual Studio Code recommended) and the latest LTS version of Node.js and npm installed
Recommended preparation:
- Read “Your First TypeScript Application” (chapter 1 in Essential TypeScript: From Beginner to Pro)
- Read “Getting to Know TypeScript” (chapter 1 in Effective TypeScript)
Recommended follow-up:
- Finish Effective TypeScript (book)
- Read Programming TypeScript (book)
Schedule
The time frames are only estimates and may vary according to how the class is progressing.
TypeScript overview (15 minutes)
- Presentation: TypeScript and its relationship to JavaScript; the benefits of using TypeScript
- Group discussion: Why do you want to learn TypeScript?
- Q&A
Installing and running the compiler (15 minutes)
- Presentation: The TypeScript website; options for installing TypeScript
- Hands-on exercise: Install TypeScript with npm and execute basic compiler commands
- Q&A
Basic types and type annotations (25 minutes)
- Presentation: Built-in types; declaring variables and functions with type annotations
- Hands-on exercise: Write, compile, and run a new function with type annotations
- Q&A
Break (5 minutes)
Intersection and union types (20 minutes)
- Presentation: Intersection and union types
- Hands-on exercise: Write a function that accepts a union type as a parameter
- Q&A
Enums (15 minutes)
- Presentation: Enums and when to use them
- Hands-on exercise: Create an enum to represent a finite set of values
- Q&A
Configuring TypeScript projects (20 minutes)
- Presentation: The role of tsconfig.json files
- Hands-on exercise: Create a tsconfig.json file using the TypeScript compiler and add desired compilation options
- Q&A
Break (5 minutes)
Classes and interfaces (55 minutes)
- Presentation: The differences between classes and interfaces; TypeScript’s structural type system; creating classes
- Hands-on exercises: Declare an interface; declare a class that implements an interface
- Q&A
Break (5 minutes)
Generics (50 minutes)
- Presentation: Generics; creating generic functions; creating generic classes and interfaces
- Hands-on exercise: Write and call a generic function; create a generic class
- Q&A
Wrap-up and Q&A (10 minutes)
Your Instructor
Brice Wilson
Brice Wilson is a professional developer with over 20 years’ experience. He’s been a developer and architect for a number of large companies, using a great many tools and programming languages. He enjoys learning, experimenting with, and teaching new technologies. His current interests are centered on web services, single-page web applications, and native mobile development.