It is traditional to start a programming course with a Hello World program. We look at a Hello World program to see the similarity to C# and to guess at what it does.
- [Narrator] Like most courses, we're going to start…with a simple Hello World program.…Let's come over to Visual Studio Code,…and create a new file which we will call HelloWorld.ts,…and that .ts is very important…because it signals to Visual Studio Code…that this is a TypeScript program.…That puts us right into the HelloWorld.ts file,…and now I'm going to create some code…that will look very familiar to you, but is TypeScript.…We're going to go over what all of this…means during the course,…but let's just take a look at what…creating a simple TypeScript program looks like.…
So we're going to say export class HelloWorld,…and we'll open it with an opening brace,…and let's put in a method, sayHi,…we put in a pair of parentheses, and braces,…that should look familiar, and we'll say console log.…Console log is very much like console write line.…And we're going to say hello world.…After we've created the class,…we can create a local variable…using let and say hello world equals new HelloWorld,…and again this is very familiar from C#,…
In this course, Jesse Liberty reviews the fundamentals of TypeScript for the C# developer, including the built-in types, flow controls, and functions. He covers default, optional, and rest parameters; lambda functions; object literals; and the creation and use of custom classes. Plus, learn about other object-oriented features such as inheritance and interfaces. By the end of the course, C# developers should be well on their way to incorporating this flexible and powerful web programming language into their app development workflow.
- Setting up a TypeScript development environment
- Working with types and variables
- Using operators to control flow
- Working with parameters and functions
- Creating classes and objects
- Exploring TypeScript inheritance
- Working with interfaces