Conteúdo do Curso
Introduction to TypeScript
Introduction to TypeScript
Summary
Congratulations!
You've taken a small step for a person but a giant leap for your successful career! You've successfully completed the beginner course on TypeScript, and that's commendable. If you've tackled all the tasks and studied the theory, you're doing great! But if you skipped chapters just to get the certificate, well, that's your problem.
Let's summarize the entire beginner course, what TypeScript is, and why it's essential. We'll revisit the basic syntax, TypeScript's advantages, and much more.
Overall
TypeScript is a general purpose programming language that serves as a superset of JavaScript. TypeScript stands out with its static typing, error highlighting during the coding phase, object-oriented programming features, and many other improvements compared to JavaScript.
TypeScript is beloved and widely used. It's the go-to choice for front-end development in many prominent companies and is a key component in various popular frameworks. The simplest example is Angular.
Syntax
To display information in the console, we use the following syntax:
If we want to declare a variable without any type, we can use the following syntax:
Typed variable:
One-line comment:
Multi-line comment:
Conditional Statements
Syntax of the if
statement:
condition
must have a boolean
type!
if-else
statement:
Switch-case:
Arrays
Declaring array:
Zero-based indexing:
It means that the first element in the array will have an index 0, the second element will have an index 1, and so on.
You can get the element from the array using it's index:
You can also modify the array's elements using their indexes:
You can explore array methods in this chapter: Working with Array Elements
Loops
while-loop
syntax:
The keyword break
is used to immediately stop the execution of a loop.
do-while
loop syntax:
The do-while
loop will execute at least once.
for
loop syntax:
Functions
Functions syntax:
How to call a function?
These are the basic concepts and syntax you've covered in this course.
From this point on, you have a foundation in TypeScript, and you can write simple programs and functions. In future courses, you will learn more advanced topics, such as object-oriented programming, classes, objects, anonymous functions, and much more.
Now, I want to congratulate you once again and wish you a well-deserved rest. You've done great!
Obrigado pelo seu feedback!